When a handler commits business state and publishes directly to a broker, either write can succeed alone: an article may be published without an event, or an event may describe a rolled-back article. section 6.5.3 section 9.5.2
The transactional outbox closes this gap by recording the event intent in the same database transaction as the business change. A rollback removes both writes; a commit preserves both. A separate relay forwards pending events, with at-least-once delivery, so consumers must handle duplicates idempotently. section 6.5.3 section 9.5.2
Publishing an article
When an article becomes published, its integration event is stored in the outbox alongside that state change. A consumer can use the event ID to recognize and skip duplicate deliveries. section 6.5.3 section 9.5.2
Figure 6.5 From handler to external delivery. The handler calls an output port whose adapter writes the integration event to the outbox within the same transaction. A relay process delivers it to external consumers. Consistency is guaranteed because the outbox write shares the domain state's transaction.
Trace the handler-to-outbox transaction and the relay to external consumers. section 6.5.3
