Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell NServiceBus to not retry a message?

Tags:

nservicebus

The "retry" system with NServiceBus is great. It works fantastic in making sure small things like dead locks don't mess us up.

However, sometimes I KNOW that a message is bad. Bad in the sense that no amount of retries is going to help.

Is there a way to tell NServiceBus: "This message is a bad apple, move it to the error queue"? (And have it skip the retries?)

like image 525
Vaccano Avatar asked Oct 09 '22 07:10

Vaccano


1 Answers

If you are using NSB 3, you can take a look at the IManageMessageFailures interface. This will allow you to plug in your functionality, but this is after the message has failed. If you would like to get at the message earlier, then take a look at the Message Mutators feature. This gets you in both at the transport layer and at the application layer.

like image 97
Adam Fyles Avatar answered Oct 12 '22 19:10

Adam Fyles