Implementation of transactional outbox pattern, a method that allows to atomically perform a local business transaction and send domain events to a message broker. The example leverages
- NodeJS as services runtime.
- Debezium as CDC platform.
- RabbitMQ as events broker.
- PostgreSQL as services data store.
The example includes a order service acting as events producer. It store events in an outbox table and performs regular business operations as part of the same database transaction. Debezium monitors the outbox table streaming new entries to RabbitMQ. The shipment service acts as message consumer reading events from the broker.
High level architecture mirrors the schema below.