Azure Service Bus主题触发器的最大传送计数 [英] Max Delivery Count with Azure Service Bus Topic Trigger

查看:96
本文介绍了Azure Service Bus主题触发器的最大传送计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用MaxDeliveryCount设置为10和DeadLetterQueue的订阅配置服务总线主题。 对于相同的服务总线主题已创建服务总线主题触发器。在服务总线主题触发器中强制将异常设置为
使消息为Abandon。

Configured service bus topic with a subscription which has MaxDeliveryCount set to 10 and DeadLetterQueue..  For the same service bus topic have created a service bus topic trigger. In the service bus topic trigger forcibly setting the exception to make the message as Abandon.

但是消息将转到DeadLetterQueue而不会到达MaxDeliveryCount。在Abandon消息到达MaxDeliveryCount之前,不会触发Service Bus Topic Trigger。 PeekLock行为是否不适用于Service Bus主题触发器? 

However message is going to DeadLetterQueue without reaching MaxDeliveryCount. Service Bus Topic Trigger is not getting triggered for Abandon messages until it reaches MaxDeliveryCount. Is PeekLock behavior is not available for Service Bus Topic Trigger? 

服务总线主题触发器代码;


使用系统;

推荐答案

服务总线队列和每个订阅分别具有 QueueDescription.MaxDeliveryCount
SubscriptionDescription.MaxDeliveryCount 属性。默认值为10.每当消息在锁(ReceiveMode.PeekLock)下传递,但已被明确放弃或锁已过期时,消息BrokeredMessage.DeliveryCount
将递增。当DeliveryCount超过MaxDeliveryCount时,消息将移至DLQ,指定MaxDeliveryCountExceeded原因代码。

Service Bus Queues and Subscriptions each have a QueueDescription.MaxDeliveryCount and SubscriptionDescription.MaxDeliveryCount property respectively. the default value is 10. Whenever a message has been delivered under a lock (ReceiveMode.PeekLock), but has been either explicitly abandoned or the lock has expired, the message BrokeredMessage.DeliveryCount is incremented. When DeliveryCount exceeds MaxDeliveryCount, the message is moved to the DLQ, specifying the MaxDeliveryCountExceeded reason code.

死信队列的目的是保存无法传递给任何接收者的消息,或无法处理的消息。这可能是由于各种原因,如超出MaxDeliveryCount,超出TimeToLive,处理
订阅规则时的错误等。

The purpose of the dead-letter queue is to hold messages that cannot be delivered to any receiver, or messages that could not be processed. This could be due to various reasons like exceeding MaxDeliveryCount, exceeding TimeToLive, errors while processing subscription rules etc.

Azure Functions运行时以PeekLock模式接收消息。如果函数成功完成,它会在消息上调用Complete;如果函数失败,则调用Abandon。如果函数的运行时间超过PeekLock超时,只要该函数正在运行,锁定就会自动更新


The Azure Functions runtime receives a message in PeekLock mode. It calls Complete on the message if the function finishes successfully, or calls Abandon if the function fails. If the function runs longer than the PeekLock timeout, the lock is automatically renewed as long as the function is running.


这篇关于Azure Service Bus主题触发器的最大传送计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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