NServiceBus MessageForwardingInCaseOfFaultConfig未正常工作 [英] NServiceBus MessageForwardingInCaseOfFaultConfig not working as expected

查看:256
本文介绍了NServiceBus MessageForwardingInCaseOfFaultConfig未正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置NServiceBus失败的消息转发到由监控的ServiceControl错误队列中。

I've setup NServiceBus to forward failed messages to an error queue which is monitored by ServiceControl.

下面是我的配置:

 <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />

当我发送失败要处理的消息,它发送到DLQ。但是,我找不到此消息的错误或error.log中队列的副本。当我看到在AMS消息细节,交货计数器设置为7,但是当我检查NSB日志,我只能找到异常一次。另外,我有点困惑,为什么这个例外将记录为INFO。它使很多难以检测的方式,但是这是一个单独的问题。

When I send a message that fails to be processed, it's sent to the DLQ. However, I can't find a copy of this message in the error or error.log queue. When I look at the message details in AMS, the Delivery Counter is set to 7, but when I check the NSB logs, I can only find the exception once. Also, I'm a bit confused as to why this exceptions is logged as "INFO". It makes it a lot harder to detect that way, but that's a seperate concern.

注:我运行在Azure服务总线传输

Note: I'm running on Azure Service Bus Transport.

任何人我错过了什么这里的想法?
在此先感谢!

Anyone an idea of what I'm missing here? Thanks in advance!

推荐答案

当处理程序试图处理消息并失败,消息将可见,将再次重试。如果传递计数队列设置较低,消息将失败处理和ASB将本地DLQ它。这就是为什么该消息中的ASB DLQ最终并没有在NSB`s配置错误队列。

When a handler is trying to process a message and is failing, message will become visible and will be retried again. If delivery count set on the queue is low, the message will fail processing and ASB will natively DLQ it. That's why the message ends up in the ASB DLQ and not in the NSB`s configured error queue.

您在DLQ-ED的消息中看到的信息被确认。在<一个href=\"http://docs.particular.net/nservicebus/azure/azure-servicebus-transport#detailed-configuration\"相对=nofollow>默认 MaxDeliveryCount 在NSB.ASB V5设置为6,所以ASB将DLQ消息尝试的那一刻消息可以处理更多比。

The information you see on your DLQ-ed message is confirming that. The default MaxDeliveryCount in NSB.ASB v5 is set to 6, so ASB will DLQ your message the moment message is attempted to be processed more than that.

这是由于NSB有它自己的(每个实例)重试计数器,而不是使用由ASB提供的本地 DeliveryCount 。如果您有您的端点向外扩展,你需要调整 MaxDeliveryCount ,因为角色的每个实例可以抓住一条消息,并试图对其进行处理。每个实例都会有它的重试计数器。作为一个结果,例如计数器可能低于6,但消息 DeliveryCount 将超过这一点。

This is due to NSB having it's own (per-instance) retry counter and not using the native DeliveryCount provided by ASB. If you have your endpoint scaled out, you'll need to adjust the MaxDeliveryCount since each instance of role can grab a message and attempt to process it. Each instance will have it's retry counter. As a result of that, instance counter could be below 6, but message DeliveryCount will exceed that.

这篇关于NServiceBus MessageForwardingInCaseOfFaultConfig未正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆