Skip to content

Dead-letter replay writes payload format incompatible with Symfony Doctrine transport serializer #700

Description

@tandev

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

  1. Use Ecotone with DBAL dead-letter support and Symfony Messenger Doctrine transport (default serializer config).
  2. Ensure defaultSerializationMediaType is JSON (default setup).
  3. Dispatch a message that fails and lands in dead letter.
  4. Replay the dead-letter message via Ecotone replay flow.
  5. 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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions