Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NServiceBus subscribe to error queue

Tags:

nservicebus

Is it possible to write an NServiceBus message handler that subscribes to error queue to allow us to perform decision making logic when an erroring message is moved there?

Preferably, I would like to keep my regular message subscribers and error queue subscribers under the same NServiceBus.host.exe process/instance if possible

Thanks

Ben

like image 462
Ben Fidge Avatar asked Mar 16 '11 10:03

Ben Fidge


1 Answers

You can have an endpoint look at the error queue. The issue will be is that you won't know why it's there. You many want to consider looking at 3.0 if you can handle that it is very early in the dev cycle. 3.0 introduces the FaultManager which includes the exception that caused the message to hit the error queue.

You won't be able to have an endpoint wired to 2 queues, you'll have to have 2 endpoints. It is best practice to have your error queue on another machine, so it would be best to have a separate endpoint on that machine.

Updated links per comment: Fault Management in 3.0 and Custom Fault Handling in 15 Minutes

like image 186
Adam Fyles Avatar answered Sep 20 '22 17:09

Adam Fyles