Support NACK on exceptions
See original GitHub issueIt’s crucial to me to nack
a message if I didn’t handle it. Currently if my application crashes the message just dissapears. I have read the documentation that says
If your subscription callback throws an exception, EasyNetQ will take the message that was being consumed and wrap it in a special error message. The error message will be published to the EasyNetQ error queue (named EasyNetQ_Default_Error_Queue). You should monitor the error queue for any messages. The error message includes all the information necessary to re-publish the original message as well as the exception’s type, message and stack trace. You can use the EasyNetQ.Hosepipe utility to re-publish error messages. See the section on EasyNetQ.Hosepipe below.
But shouldn’t it be default? It’s suprising to me that I have to create yet another queue and republish messages manually when it’s simply shouldn’t be ack
’ed.
My problem is that I must preserve messages order. If some message throws an exception then the whole queue should wait until this message gets processed. But it’s not possible if exception just makes this message to go into another queue.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (5 by maintainers)
Top GitHub Comments
Sorry for late response, I have suddenly been burrowed under tons of others tasks.
I have been tested following code:
And it worked as expected.
Thank you, it really solves the problem. All bad messages stays in the queue and are requested a bit later
3.0.0 and 3.7.5 respectively.
Well, it’s a friday, and I have to go. Let’s continue our great talk at monday. I wish you a happy weekend.