简体   繁体   English

锁定持续时间对天蓝色服务总线主题订阅的重要性

[英]Lock duration significance on azure service bus topic subscriptions

I have been looking at lockdurations and renewlock mechanisms for service bus queue and topics. 我一直在研究服务总线队列和主题的锁定和续订机制。 However it is not clear about what exactly does lock duration mean for topic subscriptions. 但是,目前尚不清楚锁定持续时间究竟对主题订阅的意义。

For example: 例如:

If i have a topic GameScoreUpdate and it has multiple subscribers. 如果我有一个主题GameScoreUpdate,它有多个订阅者。

So any message to this topic will be delivered to all the subscribers. 因此,本主题的任何消息都将发送给所有订阅者。

now if On one subscription "Subscription1", i have a lock duration of 30 seconds. 现在如果在一个订阅“Subscription1”上,我的锁定持续时间为30秒。 but message processing is not complete.then the lock expires? 但是消息处理不完整。那么锁定到期了吗?

What happens after this? 这之后会发生什么? the other subscribers have already been delivered this message. 其他订阅者已经收到此消息。 current subscriber is processing the message. 当前订户正在处理该消息。

Whats the significance of lockduration in this case? 在这种情况下,锁定的重要性是什么?

Think of each subscription as an "inbox". 将每个订阅视为“收件箱”。 Each subscriber gets one. 每个订户获得一个。 A message is sent to all subscribers, but realistically, it's a clone of the message that is placed into every "inbox", assuming it has a matching criteria. 消息将发送给所有订阅者,但实际上,它是放置在每个“收件箱”中的消息的克隆,假设它具有匹配条件。

When a given subscriber tries to process a message from an "inbox" using PeekLock mode, the message is marked as invisible. 当给定订户尝试使用PeekLock模式处理来自“收件箱”的消息时,该消息被标记为不可见。 If there's a failure to process the message in LockDuration time, the message will re-appear in the "inbox" and will be attempted for processing again. 如果在LockDuration时间内无法处理消息,则消息将重新出现在“收件箱”中,并将再次尝试进行处理。 Until MaxDeliveryCount attempts are exhausted. 直到MaxDeliveryCount尝试用尽。 In that case, message will be dead-lettered. 在这种情况下,消息将是无效的。

This is really needed for competing consumers. 这对于竞争的消费者来说确实是需要的。 Ie when your subscriber (a process looking at a given subscription/"inbox") is scaled out for processing larger number of messages. 即,当您的订户(查看给定订阅/“收件箱”的过程)被扩展以处理更多数量的消息时。

Whats the significance of lockduration in this case? 在这种情况下,锁定的重要性是什么?

LockDuration instructs a queue (subscription is a queue after all) to keep message invisible from competing consumers to ensure current processing node can handle it withing time frame defined by LockDuration . LockDuration指示队列(毕竟订阅是队列)以使消息对于竞争消费者不可见,以确保当前处理节点可以使用LockDuration定义的时间帧来处理它。 Renew lock mechanism ensures that the lock on the currently being processed message is extended to allow longer than LockDuration processing time if needed so. 更新锁定机制可确保将当前正在处理的消息的锁定扩展为允许比LockDuration处理时间更长的时间(如果需要)。 Important thing to remember, lock renewal is not guaranteed to be successful. 重要的是要记住,锁定续订不能保证成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 锁定时间到期后,我不能续订吗? 使用Azure Service Bus主题 - Can't i renew the lock after the lock duration has expired ? Using Azure Service Bus Topic 从 Azure 服务总线主题到 C# 删除订阅 - Deleting subscriptions from Azure Service Bus Topic through C# Azure Service Bus Topic订阅服务器锁定已过期异常 - Azure Service Bus Topic Subscriber lock expired exception Azure 服务总线主题,并非所有订阅都从 C# Azure 函数方法触发 - Azure Service Bus Topic, not all subscriptions trigger from C# Azure Function Method Azure服务总线主题体系结构 - Azure Service Bus Topic Architecture 使用订阅的 Azure 服务总线队列 - Azure Service Bus Queue Using Subscriptions 具有工作人员角色的Azure Service Bus主题和订阅 - Azure Service Bus Topics and Subscriptions with Worker Role 如何使用REST Client在Azure Service Bus主题上窥视锁定消息而不接收和删除 - How to Peek-Lock Message and not Receive and Delete on Azure Service Bus Topic using REST Client 当锁定持续时间未过去时,Azure 服务总线为非分区队列抛出 MessageLockLostException - Azure Service Bus throwing MessageLockLostException for non-partitioned queue when lock duration has not passed 如果设置了AutoDeleteOnIdle,服务总线是否删除没有过滤器/规则的主题订阅? - Does Service Bus Delete Topic Subscriptions with No Filters/Rules if AutoDeleteOnIdle is Set?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM