Open Source

freyr/message-broker Link to heading

Inbox & Outbox Patterns for Symfony Messenger

A Symfony bundle that brings reliable, transactional event publishing and consumption to your applications. It solves a common problem in distributed systems: ensuring that domain events are published exactly when your business transaction commits, and processed exactly once on the receiving end.

github.com/freyr/message-broker

Key features Link to heading

  • Transactional Outbox — Events are saved to the database in the same transaction as your business logic. A worker then publishes them to AMQP asynchronously, guaranteeing at-least-once delivery.
  • Inbox Deduplication — Binary UUID v7 primary keys prevent duplicate processing on the consumer side, even when messages are redelivered.
  • Typed Message Handlers — Type-safe event consumption with full IDE autocomplete. No manual deserialisation.
  • Horizontal Scaling — Multiple workers with database-level SKIP LOCKED for concurrent processing without conflicts.

How it works Link to heading

  1. Your application dispatches a domain event via Symfony Messenger
  2. The event is written to an outbox table within your business transaction
  3. A worker reads the outbox and publishes to AMQP (RabbitMQ)
  4. On the consumer side, messages are deserialised into typed PHP objects, deduplicated, and routed to handlers — all within a single database transaction

Stack Link to heading

PHP · Symfony Messenger · Doctrine DBAL · AMQP (RabbitMQ) · MIT licence


Early stage — actively under development. Contributions and feedback welcome.