-
Notifications
You must be signed in to change notification settings - Fork 45
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
Poison handling with RabbitMQ Qourum queues #114
Comments
Hi there, sorry for not replying sooner 😅 It is definitely an interesting approach, but I'm thinking that maybe it could be "upgraded" a bit and formalized as a new, optional I've published Rebus 8.2.0-alpha01 to NuGet.org just now where I've added the header under Only thing left (I think) is to make transports that support it set the header when they build the |
No problem, Christmas vacation is important! I mostly put it here to get the ideas down, and to act as a POC. I was very sure the exact implementation was going to differ since you know the code much better than me :D |
Ok I just had 10 minutes to try 🙂 I've added a test here: https://github.com/rebus-org/Rebus.RabbitMq/blob/master/Rebus.RabbitMq.Tests/RabbitMqNativeDeliveryCount.cs and the implementation just provides the value from the x-delivery-count header when it is there. Haven't had a quorum queue to test on yet, though.... feel free to take it for a spin if you like it's out as Rebus.RabbitMq 9.1.0-alpha01 on NuGet.org now |
Just took a quick look at the implementation. It probably needs to clear the header when passing the message to the error queue, otherwise simple retrying by using the Rabbit management interface to move messages from the error queue to the work queue will cause the messages to be considered failed immediately, at least that was the result from my testing originally :) But this is going to be lovely, much less dead processes when BAD things happens :D :D |
Greetings :D
I created this a long time ago for the main Rebus repo: rebus-org/Rebus#1044 where we agreed that there is no way Rebus itself can solve this.
However now that Qourum queues are well supported in RabbitMQ there is actually something we can do. From the docs here: https://www.rabbitmq.com/quorum-queues.html#poison-message-handling it is possible to check the
x-delivery-count
header. I have tacked together some code to do it, however i'm not sure if it's something that should be integrated in Rebus.RabbitMq directly:This has to be tested in a separate process and not a unit test to really test it, as it has to take down the entire process for Rabbit to do the incrementing.
I couldn't find a way to mutate headers when handling error messages except for wrapping the transport itself and having it clear the header. Outgoing pipeline decorations seems to be ignored when processing error messages.
It should probably also read the max attempts from the retry strategy, but i tried to keep it as simple as possible.
The text was updated successfully, but these errors were encountered: