Skip to content

[Messenger] add SerializedMessageStamp #44589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2021
Merged

[Messenger] add SerializedMessageStamp #44589

merged 1 commit into from
Dec 31, 2021

Conversation

nikophil
Copy link
Contributor

Q A
Branch? 6.1
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #43496
License MIT
Doc PR (will be added if PR is accepted)

This PR fixes #43496

When a message is sent for retry, we currently serialize it from the message POPO object whereas we already had the serialized representation of the message before deserializing it.

This solution proposes to store the serialized message in a "not serializable" stamp when we receive the message. Then the serialized message will be used in \Symfony\Component\Messenger\Transport\Serialization\Serializer::encode(), if the message is retried, which prevents to serialize the message again.

This has several advantages, mainly when we're dealing with big payloads:

  • it prevents the performance impact of serializing potential big objects
  • it prevents the need of a dedicated normalizer if the message comes from another system.

@carsonbot
Copy link

Hey!

I think @monteiro has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

Copy link
Contributor

@ogizanagi ogizanagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me 👍🏻

@nikophil
Copy link
Contributor Author

hi @ogizanagi
thanks for your review

I also rebased on 6.1

@chalasr
Copy link
Member

chalasr commented Dec 31, 2021

Thank you @nikophil.

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

Successfully merging this pull request may close these issues.

[Messenger] store serialized message for retry
5 participants