Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] Symfony Serializer can not serializer envelope AMQP #31460

Closed
@raress96

Description

@raress96

Symfony version(s) affected: 4.3-beta1

Description
When using the symfony serializer with the messenger component:

messenger:
    serializer:
        default_serializer: 'messenger.transport.symfony_serializer'

And together with the retry strategy, when a message fails and is retried, the first retry works ok, but on the second retry, the serialization of the envelope fails for some weird reason in Symfony\Component\Messenger\Transport\AmqpExt\AmqpSender class, in the send function the $this->serializer->encode($envelope) fails with no error and the consume command is just stopped.

From what I saw, I think it is because the Envelop is too big since it has multiple DelayStamp on it and also other stamps.

How to reproduce
Have a message fail 2 times and see what happens on the second retry using the symfony serializer.

Possible Solution
Do not have multiple DelayStamp and other stamps on the Envelope since they are only used using the $envelope->last method, so only the last one matters anyway. Not sure if this will fix the problem, but it just seems redundant to me to have multiple DelayStamp on the envelope if only the last one is used.

EDIT: One other think to mention is that not even the VarDumper component can dump the envelope object for some reason and it just doesn't display anything.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions