https://linen.dev logo
#general
Title
# general
w

Wasim AbbaCi

02/16/2024, 9:17 AM
Hi everyone, I am using wiremock in docker, When i change anything in stubs, changes don;t reflect instantly, rather it requires to restart the wiremock container.
Copy code
wiremock:
    container_name: 'app_wiremock'
    image: wiremock/wiremock
    ports:
      - "8080:8080"
    volumes:
      - ../stubs/:/home/wiremock/mappings
l

Lee Turner

02/16/2024, 11:07 AM
Hi, I don't think this is possible at the moment due to the stubs being read at the startup of the container
w

Wasim AbbaCi

02/16/2024, 11:11 AM
Nice, thank you.
c

Chris Connor

02/16/2024, 3:53 PM
I think you can hit
/__admin/reset
to re-load if that helps 🤷 (without a reboot, that is to say)
o

Orçun BALCILAR

02/16/2024, 5:15 PM
Does this work? Resetting? It is a different approach but you can keep your data at the project level and serialize your response based on this data. This way, you can change your data and response without a reboot. So for this, you need to use response transformer. But this is just an advice that comes to my mind, it is not an exact solution to your problem.
w

Wasim AbbaCi

02/21/2024, 1:27 PM
above solutions didn't work,
o

Orçun BALCILAR

02/21/2024, 1:28 PM
Did you keep your data out of the jar file and just update your data file withouting changing your source code?
c

Chris Connor

02/21/2024, 3:00 PM
This definitely works for me without rebooting the container. As Orçun says, make sure this is part of the mapped volume and not baked into the image in some way
👍 2
w

Wasim AbbaCi

02/22/2024, 2:51 PM
Copy code
curl -X POST <http://localhost:8080/__admin/mappings/reset>
making this request, it worked without restarting container. Thank you guyz for help!
🙌 1
👋 1
c

Chris Connor

02/22/2024, 3:11 PM
Awesome 🎉
❤️ 1
23 Views