6

配置/编码NServiceBus以延迟重试消息的最佳方法是什么?

在其默认配置中,重试几乎立即发生,直到配置文件中定义的尝试次数。理想情况下,我希望在一小时后重试,等等。

另外,如何HandleCurrentMessageLater()工作?Later方面指的是什么?

4

3 回答 3

6

NSB 重试用于解决死锁等临时问题。通过创建另一个进程来更好地处理更长的重试,该进程监视错误队列并以您喜欢的时间间隔将它们放回源队列。看看NSB 附带的ReturnToSourceQueue.exe以供参考。

编辑: NServiceBus 现在支持这个,我们称之为Second Level Retries ,更多细节见http://docs.particular.net/

于 2010-03-04T17:07:11.190 回答
4

Here is a blog post on why NServiceBus doesn't include a retry delay that I wrote after asking Udi this very same question in his distributed systems architecture course:

NServiceBus Retries: Why no back-off delay?

And here is a discussion thread covering some of the points involved in building an error queue monitor/retry endpoint:

http://tech.groups.yahoo.com/group/nservicebus/message/10964

As far as HandleCurrentMessageLater(), all that does is puts the current message back at the end of the queue. If there are no other messages waiting, it's going to be processed again immediately.

于 2011-07-30T20:16:28.563 回答
4

从 NServiceBus 3.2.1 开始,它们提供了一个开箱即用的解决方案来处理连续消息失败时的回退延迟。以前存在的重试机制仍然会立即重试失败,以处理数据库死锁、快速自愈网络问题等情况。

一旦消息被重试了配置的次数,该消息将被移动到“二级重试”队列。如下配置的该队列将在 10、20 和 30 秒延迟后重试,然后将消息移动到配置的错误队列中。您可以自由地将这些值更改为更适合您的环境的值。

您还可以查看此链接: http ://docs.particular.net/nservicebus/second-level-retries

于 2012-06-05T21:04:12.057 回答