I\'m currently working on a Spring Boot microservices project. I have created services and each service is running separately. With this, I need some services to communicate wit
There are different ways to communicate between microservices. But which one to use: depends on the usecase.
Api call
: That is making actual rest api call to the other service using RestTemplate
, FeignClient
etc as. ResponseType obj= new RestTemplate().getForObject(URL, ResponseType.class, params);
customer name
and other details in orders
database as well. Once the customer update their name, you have to update the details in Orders database as well . How this can be done. Through API call
? Then what if account microservice also needs this update. So Rest api will be an overhead. In this use case we can use MessageQueues
like RabbitMQ
. Customer microservice will create an event of customer update and which ever microservice is interested in this can subscribe.Communication through message queue like RabbitMQ
Spring.io rabbit mq guide