Transactional outbox
Outbox Pattern, Pattern: Transactional outbox, на сайте с June 09, 2023 13:48
A service command typically needs to create/update/delete aggregates in the database and send messages/events to a message broker. For example, a service that participates in a saga needs to update business entities and send messages/events. Similarly, a service that publishes a domain event must update an aggregate and publish an event.
The command must atomically update the database and send messages in order to avoid data inconsistencies and bugs...