PeekLock Microsoft Azure 服务总线
PeekLock Microsoft Azure Service Bus
我正在使用多个消费者,以便使用 ReceiveMode.PeekLock 从队列中接收消息。当我锁定一个消费者的消息但没有完成消息的接收以便从队列中删除时,其他消费者无权访问它。
我的问题是,当该消息被锁定且尚未从队列中删除时,其他消费者是否可以访问其他消息,或者他们被阻止尝试出队并从该队列接收任何其他消息?
是的,消费者确实可以访问队列中的其他条消息,只是不能锁定.
否则基于队列消息的缩放将无济于事,因为其他消费者将等待第一条消息被处理,之后每个人都在等待的消费者将能够接收下一条消息...
来自Peek-Lock Message (Non-Destructive Read)
This operation atomically retrieves and locks a message from a queue or subscription for processing. The message is guaranteed not to be delivered to other receivers (on the same queue or subscription only) during the lock duration specified in the queue/subscription description. When the lock expires, the message becomes available to other receivers. In order to complete processing of the message, the receiver should issue a delete command with the lock ID received from this operation. To abandon processing of the message and unlock it for other receivers, an Unlock Message command should be issued, otherwise the lock duration period can expire.
我正在使用多个消费者,以便使用 ReceiveMode.PeekLock 从队列中接收消息。当我锁定一个消费者的消息但没有完成消息的接收以便从队列中删除时,其他消费者无权访问它。
我的问题是,当该消息被锁定且尚未从队列中删除时,其他消费者是否可以访问其他消息,或者他们被阻止尝试出队并从该队列接收任何其他消息?
是的,消费者确实可以访问队列中的其他条消息,只是不能锁定.
否则基于队列消息的缩放将无济于事,因为其他消费者将等待第一条消息被处理,之后每个人都在等待的消费者将能够接收下一条消息...
来自Peek-Lock Message (Non-Destructive Read)
This operation atomically retrieves and locks a message from a queue or subscription for processing. The message is guaranteed not to be delivered to other receivers (on the same queue or subscription only) during the lock duration specified in the queue/subscription description. When the lock expires, the message becomes available to other receivers. In order to complete processing of the message, the receiver should issue a delete command with the lock ID received from this operation. To abandon processing of the message and unlock it for other receivers, an Unlock Message command should be issued, otherwise the lock duration period can expire.