A message relay moves unpublished messages from an outbox to a message broker. In a relational database setup, the service inserts messages into the outbox within the transaction that changes business objects, making both changes atomic. section 8.3.8
A polling relay follows this sequence:
- Periodically query the outbox for unpublished messages. section 8.3.8
- Publish each message to the broker’s destination channel, then delete it from the outbox. 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.
Shows the service writing to the outbox within a database transaction and the relay publishing those messages to a broker. section 8.3.8
