Symfony 8.2 lets Messenger talk to apps written in other languages
A new interop serializer strips Symfony-specific envelope stamps from queued messages, so a shared RabbitMQ transport can be read by Go, Python or Node.js consumers too.
Symfony 8.2 ships a new messenger.transport.interop_serializer service for the Messenger component. Until now, Messenger’s default serializer attached PHP-specific envelope stamps to every message, so a non-Symfony consumer reading from the same transport, or even an older Symfony app without the right stamp classes, would fail to decode it.
The interop serializer sends only a JSON body and plain headers, dropping Symfony stamps and ignoring any it receives. Message identity survives the trip through #[AsMessage(serializedTypeName: 'shop.order_placed')], which gives a message a language-agnostic name, and through stamp header mappers, which convert specific stamps like MessageIdStamp into plain headers such as message_id rather than serialized objects. You opt in per transport:
framework:
messenger:
transports:
orders:
dsn: '%env(ORDERS_TRANSPORT_DSN)%'
serializer: messenger.transport.interop_serializer
Using it requires Symfony 7.4.18+ or 8.1.6+ on every application sharing the transport.
Why it matters: if you’ve been bridging Symfony services to other languages with webhooks because Messenger’s own serialization was too PHP-specific, this removes that reason. A Go or Node.js worker can now consume directly off the same RabbitMQ queue as your Symfony app.