How to Call Multiple Microservices in Parallel
The problem is solving using Java 8’s CompletableFeatures & Spring Boot 2.x. We need to fetch all the records for the list provided and filter records from the list based on some attributes of the objects. The records can be fetched from another microservice (B) which takes id as an argument and returns the JSON of that record. The advantage of approach # 1 is that the processing time of fetching each record will be reduced to the max time taken by any of the service calls.
Join Hacker Noon
Create your free account to unlock your custom reading experience.