The problems we solve
-
Events lost when a service crashes between the database write and publishing the event.
-
The same message processed twice: stock reserved twice, an email sent twice.
-
A RabbitMQ topology that grows with every new use case.
-
Message contracts that break in production even though the tests passed.
-
User interfaces that poll the server over and over to see a change.
What we put in place
-
A simple topology: one exchange, one queue per consuming service.
-
The outbox pattern on the producer side, idempotency on the consumer side.
-
Versioned contracts: JSON Schema, DTOs and regression tests.
-
Explicit error handling: retry, dead letter queue, replay.
-
Real-time updates to the user interfaces with Mercure.
-
A reasoned choice of broker: RabbitMQ, Kafka, or both.
Articles
Splitting an event-driven architecture: six axes to decide
Data ownership, messages, transport, push to the fronts, shared code, transactions: the six axes of an event-driven architecture, a services map and procedures.
11 min read
Real time with Mercure, no BFF: domains, cookies and JWTs
Pushing order updates to Vue fronts without a BFF: a Mercure 1.0 hub, a cookie on the parent domain and one restricted publisher token for each service.
11 min read
Kafka or RabbitMQ? Keep RabbitMQ and replay from the outbox
Replaying events without moving to Kafka: the outbox, kept for a long time, becomes a log that we republish to the queue of a single RabbitMQ consumer.
11 min read
Dead letter queues with RabbitMQ and Symfony Messenger
A message that fails forever clogs its queue. Retries with a growing delay, then quarantine: Messenger failure transport or RabbitMQ DLX, two distinct levels.
4 min read
Message contracts in a monorepo: JSON Schema and DTOs
In a monorepo, a message change passes the tests, then breaks in production. A shared contracts package, additive changes and frozen fixtures prevent it.
11 min read
Idempotent consumer with Symfony Messenger: the processed_event table
The same event can arrive twice. A processed_event table, written in the same transaction as the effect, discards the duplicate with Symfony Messenger.
11 min read
The Outbox pattern with Symfony Messenger: publish without losing events
Writing to the database then publishing can lose an event. The outbox writes it in the same transaction, a relay publishes it: Messenger, Doctrine, PostgreSQL.
11 min read
RabbitMQ: one topic exchange and one queue per consuming service
Several services react to the same event? A single topic exchange, one queue per consuming service and versioned routing keys, with Symfony Messenger.
9 min read