[英]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.