Hi,
First of all congratulations for this great library. Its simple to use, good documentation and more importantly: it works! :)
My issue is related with the fact that I need to record not one external service but many of them. It seems that the wiremock-standalone just has the option to setup one proxy using the --proxy-all
switch. Is it possible to record with my own defined stubs? If no, is there any other to achieve this?
Thanks a lot!
Leo
Thanks!
Yes, it is possible to record against multiple targets by configuring a proxy stub mapping against each of them via the API rather than via the --proxy-all param (which actually just creates a single proxy mapping internally).
hi @tomakehurst . I am also attempting to record against multiple services. However it is not clear to me how to do it. The only way I can record is against one service via --proxyAll. Could you give me an example on how to do the above please?
hi @tomakehurst My API has multiple exernal API calls and i need to mock that by recording them. I am getting unauthorised error. However if i make calls to the external apis directly i am able to record them could you please help.
Hi; I just used wiremock to do some load testing in docker and it worked great; FWIW being able to record multiple urls at once would be nice, e.g. in docker-compose
I had a single wiremock
instance, and then gave my app both SERVICE_A_URL=http://wiremock/
and SERVICE_B_URL=http://wiremock
as environment variables, but it meant I had to stop/start wiremock
a few times to change the proxy-all
from service a, record a request, shut it down, change proxy-all
to service b, record a request, shut it down.
Doing something like --proxy-host=servicea:http://service-a.company.com --proxy-host=serviceb:http://service-b.company.com
and then using host headers (e.g. SERVICE_A_URL=http://servicea/
within docker-compose
) would be spiffy (specifically for recording requests that touch multiple services).
Great tool; thanks!
How to record against multiple targets by configuring a proxy stub mapping against each of them:
{
"mappings": [
{
"request": {
"method": "ANY",
"urlPattern": "/api/.*"
},
"response": {
"proxyBaseUrl" : "http://example1.com"
}
},
{
"request": {
"method": "ANY",
"urlPattern": "/content"
},
"response": {
"proxyBaseUrl" : "http://example2.com"
}
}
]
}
Most helpful comment
Thanks!
Yes, it is possible to record against multiple targets by configuring a proxy stub mapping against each of them via the API rather than via the --proxy-all param (which actually just creates a single proxy mapping internally).