使用 NServiceBus 将错误消息移动到特定队列
根据 NServiceBus FAQ,我们不应该处理异常。 相反,NServiceBus 管道会将错误消息从总线上取下,并将其移至错误队列。 问题是,您无法通过查看错误队列上的消息来判断到底是什么导致了错误。 我们通过记录任何异常来解决这个问题,但这仅仅意味着我们现在必须检查错误消息的时间戳,并将它们与错误日志进行匹配。
将错误消息路由到特定队列是个好主意吗?如果是这样,你如何在 NServiceBus 中做到这一点?
我想我可以创建特定的错误队列,以便支持人员可以更轻松地处理错误。
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 exceptions, 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看github上的trunk。有一个新的FaultManager 概念,其中包含异常详细信息。您可以开箱即用地处理内存中的故障、转发到特定队列或通过 NHibernate 将故障存储到数据库。
如果您想在当前 NSB RTM 的基础上构建,您可以实现一些东西来监视通用错误队列并从那里转移消息。
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.