Transactional outbox pattern example in Golang and MongoDB

For a personal project, I was experimenting with DDD. I was sending domain events through RabbitMQ to run choreography-based sagas. One problem I had was ensuring that the domain event got sent out after modifying aggregates. It’s not possible to run an atomic transaction through MongoDB and RabbitMQ, so there can be a situation where the aggregate is modified successfully in the database, but we won’t send an event because RabbitMQ is not available....

July 2, 2023 · 5 min