Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Lease-Based and Lock-Based exclusive access in Azure Queues

I know (reading the msdn documentation here) that Windows Azure Storage Queues use a lease-based exclusive access strategy to the messages and Azure Service Bus Queues use a lock-based one. In both I can set the maximum duration of lock/lease. So, which are the most important differences between these two methods? Could someone provide a clear/short example? Thanks.

like image 207
outlookrperson Avatar asked Dec 20 '25 04:12

outlookrperson


1 Answers

In both cases when you read a message, the message is locked (or leased) and others cannot access it. Difference is, for Storage Queue you can define the lease duration for the message itself (by default is 30 seconds, it can be up to 7 days) so you as the client (publisher) can specify this when pushing the message to the queue; whereas for Service Bus the lock duration is defined at the queue or topic level (default is also 30 seconds), so you as a client (publisher) cannot control this.

like image 96
Gedeon Avatar answered Dec 21 '25 19:12

Gedeon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!