Closed kmuthugtk closed 3 years ago
You cant make async communicate in that case. this is the topic that data management in microservices. there are several best practices that you can use. my recommendation is duplicate customer data in invoice microservice and update customer data async when it is changed in customer microservice by triggering an event to event bus.
https://docs.microsoft.com/en-us/dotnet/architecture/cloud-native/distributed-data
https://blog.christianposta.com/microservices/the-hardest-part-about-microservices-data/
I have two Microservices. First Service for Customers and Second service for Invoice Service.
In Invoice MicroService, I will save only CustomerId in Invoice services. Using this CustomerId, I would like to retrieve all the related data for Customer Microservice. But i don't know to communicate async.
Any please get me some ideas and examples