WireMock recording in context of microservices - one client calling many servers

156 Views Asked by At

In my project, there are more than 100 microservices. In my case, I want to test my microservice independently from any other external service.

The scenario of my microservice "A" - main number crunching microservice, which I am targetting to test independently of other external services. In my scenario Actor Request "A" to perform an action and then "A" get some data from "B" "D" "C" and perform complex logic and return a response back to Actor

enter image description here

To Test A independently, I intend to use Wiremock to record various request-response from A to other microservices (B, C, D)

As, I understood from Wiremock documentation, to use record feature of Wiremock we have to unable --proxy-all to target services with respect to the client and then request to host:port of Wiremock which is in-turn forward to actual service and request/response is recorded.

But in my case it is not possible as I am in the microservices world. Service "B", "C", "D" runs on random port and in my actual scenario A gets the address of B from Service Registry so even if I manually start many Wiremock with proxying target services still I would not be able to reproduce the request to wiremock (which in turn get proxied to respect service).

So how to record my desired request and response (from target microservice "A" to "B", "C" and "D".

0

There are 0 best solutions below