Hi team, I'm using WireMock standalone version bei...
# help
m
Hi team, I'm using WireMock standalone version being run in an Azure container, and I’m running into issues with proxying and mapping creation. I’d like to configure WireMock to use custom mappings when available and proxy all other requests to the real API. Current setup in terraform: "WIREMOCK_OPTIONS" = "--port 55555 --proxy-all https://xxx --record-mappings --verbose" Issue: • With --proxy-all enabled, custom mappings are not created through the API and even if I create them manually, they are ignored, and all requests are proxied directly to the real API. • Without --proxy-all, mappings are created via API and work fine, but unmatched requests are not proxied to the real API. Any guidance on getting this setup to work correctly would be appreciated. Thank you!
r
you'll want to create a proxy stub mapping with low priority that will handle any unmatched requests. more info here https://wiremock.org/docs/proxying/#proxy-stub-mappings
m
Rafe, thank you for the quick response! It works like you say, but does it mean that —proxy-all is not something I could use in this case?
r
actually, looking at the source code, im not sure why --proxy-all would prevent you from creating new mappings. it looks like it works in the exact way manually creating a proxy stub, like i recommended, works
what version of wiremock are you using?
ah i think it's because you've also set the
--record-mappings
option which is for recording mappings. if you want your requests to match existing stub mappings, you don't want to be recording