Using NServiceBus to move error-ed messages to a specific queue
According to the NServiceBus FAQ, we shouldn't handle exceptions. Instead the NServiceBus pipeline will take the error-ing message off the bus, and move it to an error queue. Trouble is, you can't tell by looking at the messages on the error queue what actually caused the error. We work around that by logging any excep开发者_如何转开发tions, but that just means we now have to check the time stamps of the error messages, and match them with the error log.
Is it a good idea to route error-ed messages to a specific queue? If so, how can you do this in NServiceBus?
I was thinking that I could create specific error queues so that support staff could handle errors easier.
Take a look at the trunk on github. There is a new concept of a FaultManager that includes exception details. Out of the box you can handle faults in memory, forward to a specific queue, or store the fault to a database via NHibernate.
If you want to build on the current NSB RTM you could implement something to watch the generic error queue and divert messages from there.
精彩评论