Ecotone version(s) affected: 1.326.1
Description
When a message is moved to dead letter, Ecotone serializes the failed Message payload to JSON using OutboundMessageConverter and defaultSerializationMediaType in ErrorChannelService (vendor/ecotone/ecotone/src/Messaging/Handler/Gateway/ErrorChannelService.php:44).
During replay, DbalDeadLetterHandler restores payload and headers, then pushes the message back into Symfony transport without converting payload format for the target transport (vendor/ecotone/dbal/src/Recoverability/DbalDeadLetterHandler.php:102).
With Symfony Doctrine transport default behavior, messages are encoded with Symfony Messenger’s PHP serializer (vendor/symfony/doctrine-messenger/Transport/DoctrineSender.php:39).
As a result, replayed payload content (JSON from Ecotone DLQ flow) is incompatible with what Doctrine transport expects (PHP-serialized envelope/body format), causing invalid data in messenger_messages and replay failures.
How to reproduce
- Use Ecotone with DBAL dead-letter support and Symfony Messenger Doctrine transport (default serializer config).
- Ensure
defaultSerializationMediaType is JSON (default setup).
- Dispatch a message that fails and lands in dead letter.
- Replay the dead-letter message via Ecotone replay flow.
- Observe that replay writes payload/body in a format that does not match Doctrine transport serializer expectations.
Context
- Alternative Solutions to solving this inside ecotone:
- Adapt DoctrineTransport to use JSON instead of serialized php
- Create own ErrorHandler with an more Symfony-Messenger like approach (Create another symfony messenger based dead letter queue)
Ecotone version(s) affected: 1.326.1
Description
When a message is moved to dead letter, Ecotone serializes the failed
Messagepayload to JSON usingOutboundMessageConverteranddefaultSerializationMediaTypeinErrorChannelService(vendor/ecotone/ecotone/src/Messaging/Handler/Gateway/ErrorChannelService.php:44).During replay,
DbalDeadLetterHandlerrestores payload and headers, then pushes the message back into Symfony transport without converting payload format for the target transport (vendor/ecotone/dbal/src/Recoverability/DbalDeadLetterHandler.php:102).With Symfony Doctrine transport default behavior, messages are encoded with Symfony Messenger’s PHP serializer (
vendor/symfony/doctrine-messenger/Transport/DoctrineSender.php:39).As a result, replayed payload content (JSON from Ecotone DLQ flow) is incompatible with what Doctrine transport expects (PHP-serialized envelope/body format), causing invalid data in
messenger_messagesand replay failures.How to reproduce
defaultSerializationMediaTypeis JSON (default setup).Context