-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Message is lost if it cannot be processed by both handler and failed transport #36870
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
Comments
Please elaborate. What I can see as solution for your case is to remove the RejectRedeliveredMessageMiddleware when retries are disabled. |
Unfortunately it should be removed in any case. If retries are enabled, but all attempts exceeded (and DB is still down), same issue will happen: message will be lost.
This is my point of view:
|
Hey, thanks for your report! |
It is indeed relevant. As a workaround we had to build our own messaging library on top of symfony messenger. |
Since I got no negative feedback, created PR #40249 |
Hey, thanks for your report! |
Yes, this is still actual, we cannot use native Messenger component because of this issue - it does not guarantee that messages will not be dropped randomly. My MR solves the problem, but it need to be reviewed. |
Hey, thanks for your report! |
Yes, the bug is still relevant and fix effort are still offered |
Hey, thanks for your report! |
I stopped using Symfony Messenger because of this issue, so I am not sure if bug is relevant. But I can see that the fix for the bug is still not merged and issue is ghosted. |
Hello, I worked on #39622 and I faced something similar. Indeed, there is a flaw in the design of the component. There is many cases where a message can be lost. Usually, components that deal with messaging proceed like this
But there are many places in symfony/messenger that does the following
And, obviously, something can go wrong between 3. or 5. Some examples:
I did not search for all issues, but IIRC there are other places. |
Hey, thanks for your report! |
Hi bot, I will just repeat my previous comment: |
I guess this issue is still relevant |
Fixed by ##51848, right? |
I believe so. Please put a comment if you have a reproducer proofing that this is not yet fixed. |
Symfony version(s) affected:
From
4.4
tomaster
Description
When message cannot be processed and cannot be written to failed transport, it gets lost.
How to reproduce
RejectRedeliveredMessageMiddleware
which prevents message being stuck in queue.In my opinion this is dangerous behavior which makes implementation of proper resilient applications impossible with Messenger component. The component must guarantee that with proper configuration messages will never be lost implicitly.
So expected behavior from my side:
Possible Solution
Remove this class and it's definition from DI: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Messenger/Middleware/RejectRedeliveredMessageMiddleware.php
Also remove this code: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Messenger/Worker.php#L116-L120
To prevent messages being stuck in queue other solutions should be applied:
Additional context
I can implement a change myself, but I would like to raise it first and discuss. Someone implemented
RejectRedeliveredMessageMiddleware
, so there could be other use-case for it.The text was updated successfully, but these errors were encountered: