简体   繁体   中英

What is the best approach to communicate between services in event-driven design

As I know there is 2 different way to handle transaction in microservices (2PC and saga). The saga as mentioned here uses events that based on local transactions in each services. So when a local transaction has done or failed its job we should notify other services to process their job. The Questions is that what is the best approach to send and receive notifications throw microservices? A message broker (Which message broker is best one to handle )? or Rpc protocol? or something else?

In event-driven design you are quite free to handle how the events are propagated through your system.

As a personal preference I would use a broker or event bus. That may depend on your usage of event distribution. If you want to support only a single receiver per topic then go with RabbitMQ or an alternative. When you have multiple receivers that are interested in the same topic I would suggest you to use Kafka . It is highly scaleable and quite easy to integrate in most languages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM