Description
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.