A polling publisher moves messages from a database outbox to a message broker. A separate MessageRelay periodically queries the outbox for unpublished messages, sends each to its destination channel, then deletes it from the outbox. section 8.3.8
Choose the pattern with its operating trade-offs in mind:
- Polling is simple and works reasonably well at low scale, but frequent database queries can be expensive. section 8.3.8
- With NoSQL, efficient polling depends on whether the database can query business entities with pending messages. Consider transaction-log tailing when polling is too costly or impractical. section 8.3.8
Figure 8.17 A service reliably publishes a message by inserting it into an OUTBOX table as part of the transaction that updates the database. The Message Relay reads the OUTBOX table and publishes the messages to a message broker.
The diagram shows the outbox-to-relay-to-broker flow. section 8.3.8
