Event Bus and Message Brokers
Utilize message brokers and event buses to facilitate reliable asynchronous communication for choreography sagas.
Reliable Choreography Sagas
In a choreography saga, services communicate by exchanging events. For this to work reliably in a distributed system, we need robust communication mechanisms.
Imagine an order being created, then needing payment, and finally shipping. Each step is an event triggering the next service.
- Order Service publishes
OrderCreated - Payment Service subscribes to
OrderCreated, publishesPaymentProcessed - Shipping Service subscribes to
PaymentProcessed, publishesShipmentScheduled
What's an Event Bus?
An Event Bus is a pattern that enables different parts of an application (or different services) to communicate by sending and receiving events without knowing about each other directly.
Think of it as a central hub where events are broadcast. Any interested party can 'listen' for specific events.
It decouples services, meaning they don't need to know who will process their events, only that an event occurred.
All lessons in this course
- Designing Event-Driven Sagas
- Event Bus and Message Brokers
- Handling Compensation with Events
- Building Idempotent Event Consumers