使用 NServiceBus 将错误消息移动到特定队列

发布于 2024-10-06 17:24:27 字数 267 浏览 0 评论 0原文

根据 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

渡你暖光 2024-10-13 17:24:27

看看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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文