I have 3 replicas of each microservices service1, service2, service3. Service1 is supposed to send a message to service2(with generated request_id) and after successfully getting the response, wait for the callback from the service3. The requestresponse is linked to the callback, by request_id.
I wanted to implement this communication with reactive fluxmono:
Mono.fromCallable(() -> request)
.flatMap(webClient.post(request))
.doOnNext(..wait for the callback and process it..)
Can u suggest a solution how to properly wait for the callback, keeping in mind that microservices run in k8s cluster, and the callback must be send to a particular pod(app running service1)