-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Be able to get raw data when a message in not decodable by the PHP Serializer #39622
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
Conversation
3423f53
to
ca0627b
Compare
src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php
Outdated
Show resolved
Hide resolved
ca0627b
to
25ce8d1
Compare
src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Command/FailedMessagesRemoveCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Command/FailedMessagesShowCommand.php
Outdated
Show resolved
Hide resolved
ping @symfony/mergers : What do you think about this PR? IMHO this is really needed to be able to explore "dead" messages. And what do you think about the new Should I address comments and add some tests, or we gonna close it anyway? |
Indeed, this could be very useful |
before reviewing, do you still want this in core? can you please rebase + fix review comments if yes? |
Yes it would be very useful! I'll rebase it ASAP 👍🏼 |
6d37c94
to
292d6cf
Compare
I rebased the PR. and added some tests. |
4c0d36f
to
6e3065a
Compare
src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php
Outdated
Show resolved
Hide resolved
6e3065a
to
8ae4ed5
Compare
src/Symfony/Component/Messenger/Command/FailedMessagesShowCommand.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after two minor CS changes. Thanks.
src/Symfony/Component/Messenger/Command/FailedMessagesRemoveCommand.php
Outdated
Show resolved
Hide resolved
…y the PHP Serializer
8ae4ed5
to
34229af
Compare
@nicolas-grekas I addressed your comments, replay all examples, and updated the PR description. I think it's OK |
Thank you @lyrixx. |
This PR was merged into the 6.2 branch. Discussion ---------- Fix typo in method retrySpecificEnvelopes | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix for #39622 | License | MIT Commits ------- e5675ac fix typo in method retrySpecificEnvelopes
… of passing boolean flags (xabbuh) This PR was merged into the 6.2 branch. Discussion ---------- [Messenger] add dedicated method for disabling instead of passing boolean flags | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes (changes #39622) | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- 99fac74 add dedicated method for disabling instead of passing boolean flags
It will be planned to backport to 6.1 ? |
No, it will be released in 6.2 only |
It's easier to review the pr with
?w=1
Why?
This PR aimed to handle properly messaged that are already failed and also not decodable anymore.
This use case occurs when a Message class is renamed / moved to another namespace
Reproducer
App\Message\Foobar
Foobar
toFoo
Before / After
command
messenger:failed:show
Before
Without an ID
And this message is lost
With an ID
Message lost too
After
Without an ID
No messages are lost
With an ID
messages not lost
With an ID an -vv
screenshot with colors
messages not lost
command
messenger:failed:retry
Before
And the first message is lost
Same if I use an ID
After
Without ID
And the message is not lost
With an ID
command
messenger:failed:remove
Before
The message is lost, but it's not an issue I guess :p
After
Extra
messenger:consume
commandThis command is not fixed on purpose: We keep the default behavior to keep a BC.
BUT I would like to use the same stamp system I introduce to avoid loosing a message.
Because ATM, when a DecodeException is thrown, the message is lost. Not cool!