We are currently studying the possibility of transforming our existing monolith application into fine-grained Microservices running along an API gateway for coordination.
I have this case where there are three microservices:
1- Product Microservice: A REST API service for products. 2- Category Microservice: A REST API service for categories. 3- Aggregation Microservice: A REST API service which joins between a list of categories and their products and then return them into one model.
According to the attached image, any client can send a request to the API Gateway specifying which microservice he wants to retrieve information from in addition to all request options like HTTP method and request body.
The API gateway will receive the client's request and use service discovery reroute it to the designated microservice.
My question is, what if the client tries to contact the aggregation microservice? This will result in a request to the API gateway and then the API gateway will reroute to the aggregation service. However, the aggregation service needs to contact both category and product services in order to reply back to the client with a unified model. This requires the aggregation microservice to also contact the API gateway again so it can reroute its requests to the category and product microservices.
There seem to be a lot of communication traffic occurring here, am I missing something here or this is the right way to implement such scenario.