Closed
Description
Description
When a message is sent for retry, we serialize it from the message POPO object whereas we had the serialized representation of the message before deserializing it.
What if we would store this serialized string once it arrives in messenger, and then use it back if a retry is needed?
This has several advantages, mainly when we're dealing with big payloads:
- prevents the performance impact of serializing potential big objects
- prevents the need of a dedicated normalizer if the message comes from another system.
Solution
The solution would be to create a SerializedMessageStamp implements NonSendableStampInterface
in \Symfony\Component\Messenger\Transport\Serialization\Serializer::decode()
and use the content of this stamp in \Symfony\Component\Messenger\Transport\Serialization\Serializer::encode()
if it exists.