Skip to content

[Messenger] store serialized message for retry #43496

Closed
@nikophil

Description

@nikophil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions