Outbox Message Register
Dependency Graph
Class Diagram
Introduction
The solution is for the service that sends the message to first store the message in the database as part of the transaction that updates the business entities. A separate process then sends the messages to the message broker.
The participants in this pattern are:
- Sender - the service that sends the message
- Database - the database that stores the business entities and message outbox
- Message outbox - if it’s a relational database, this is a table that stores the messages to be sent. Otherwise, if it’s a NoSQL database, the outbox is a property of each database record (e.g. document or item)
- Message relay - sends the messages stored in the outbox to the message broker