Transactional outbox: publishing order events
Save each event in the same transaction as the order, and let a relay publish it to the broker.
Level Advanced
What you will see
- Saved, but never announced
- Two writes, one can fail
- The order and its event, in one transaction
- The relay publishes, then marks
- Consumers that tolerate duplicates
- When a lost message is acceptable
Before / after
Base: naive-crud-goView the diff