-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WIP][Messenger] Handling & Tracking Failed Messages Support #30766
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
fb2d733
to
9590c86
Compare
src/Symfony/Component/Messenger/Failure/FailedMessageStorageInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Failure/DbalFailedMessageStorage.php
Outdated
Show resolved
Hide resolved
9590c86
to
a0fd22b
Compare
This PR has the "guts" of it done, but is still unfinished. What do people think about this idea? I wanted to get some validation before pushing it forward. I personally would love this, because I could "re-try" messages that truly failed, instead of losing them. |
Indeed, we need such a mechanism so it's a big 👍 on my side. Though... I'm not convinced we should have it outside of each transport (yet?).
So it's the responsibility of these transports to make it happen... but actually, is it true? Realistically a "dead letter queue" has nothing special, it's just another queue. Though it's permanent and nothing is listening to it. So technically speaking we have it in the Doctrine transport: we just need to use another |
This is still on my list, but if anyone wants to help me, please ping me! My schedule this week and next is not great for having a lot of time! |
Closing in favor of #30970 |
Hi @weaverryan - It looks to me that's it not possible to use the "native" feature of (e.g.) SQS for dead-letter queues? I really don't want to use the "failure transprt" in #30970 . |
Hi o/!
This is a proposal to add global "failed messages" handling to Messenger. Messages are already retried a configurable number of times. But what happens if those all fail (e.g. due to a temporary network issue with an external service)? Currently, the messages are rejecting and lost. There is an event the user can hook into, but I think we can do better.
In this system, the envelopes would be "stored" somewhere for later. There would be 3 new commands you could use to handle them:
The configuration would probably look like this:
Most true messaging/queuing systems (AMQP, SQS) already have a concept of a "dead letter queue/exchange", where you can configure failed messages to go to. And this is something that we can/should document using if people are interested. However, they have few practical disadvantages. First, since these are normal queues, you can "consume" them, but you can't easily see a full list of them or look at once specific one to decide if you want to retry or remove it. Second, less robust transports like Redis & Doctrine do not have dead letter exchanges/queues built in.
Cheers!