PHP Symfony Event-Driven ArchitectureMessage Queue DevelopmentBackend DevelopmentBackend Engineering 2 min read

Symfony 8.2 Introduces Inbox Feature for Messenger Idempotency

The new inbox feature in Symfony 8.2 simplifies message handling by using database transactions to automatically prevent duplicate processing of redelivered messages.

Symfony 8.2 introduces an inbox option for Messenger. Nicolas Grekas contributed the feature, announced on October 26, 2026.

Message brokers use an at-least-once delivery model. If a worker commits database changes but crashes before acknowledging a message, the broker redelivers it. Previously, developers built manual idempotency into every handler to prevent duplicate processing like double charges. The new inbox pairs with the existing Messenger outbox, which saves outgoing messages inside the same database transaction as application changes.

During handler execution, Symfony stores the transport name and message ID in a messenger_inbox table within the same transaction. If a redelivered message exists in that table, handlers are skipped and the message is acknowledged. Failed handlers roll back the transaction, removing the inbox entry so retries can proceed. If concurrent workers receive the same message, the second worker waits for the first transaction to finish.

Configuration requires three steps. Set inbox: true on a transport or specify a connection name. Enable identity_stamps: true. Add the doctrine_transaction middleware to the bus. You can create the table using the messenger:setup-transports command or via a Doctrine migration.

Limits:

  • Requires symfony/doctrine-messenger and shares the database connection with handlers.
  • Retention defaults to 7 days and must exceed transport redelivery times.
  • Failure transport retries record under the original transport.
  • Batch handlers do not record in the inbox.
  • Messages using DispatchAfterCurrentBusStamp require an outbox to prevent message loss.