NServiceBus subscribe to error queue
Asked Answered
C

1

6

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

Chondrule answered 16/3, 2011 at 10:15 Comment(0)
V
5

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

Verlinevermeer answered 16/3, 2011 at 12:22 Comment(2)
Great suggestion. @Adam's blog also has these 2 articles on the subject that are worth reading: [adamfyles.blogspot.com/2011/01/… [adamfyles.blogspot.com/2013/02/…Fetal
Those links are dead as of Sept 1 2013.Prenomen

© 2022 - 2024 — McMap. All rights reserved.