5

I have an Azure Service Bus Queue.

It's configured with:

  • Requires Duplicate Detection: true
  • Requires Session: true
  • Enable Partitions: false
  • Max Delivery Count: 10
  • Lock Duration: 1 minute
  • Batch Operations Enabled: true
  • Deadletter on Expiration Enabled: false
  • Enforce message ordering: true

When retrieving a message from the queue I use the following OnMessageOptions:

  • AutoComplete: false
  • AutoRenewTimeout: 12 minutes

Each message takes on average 2 minutes to complete.

Some of them succeed, others throw a "SessionLockLostException".

Why does the lock "AutoRenew" not keep the message lock renewed? It's supposed to keep doing it's job for 12 minutes, yet we get that exception after 2.

How do you debug the cause of the exception? The exception tells me roughly what happened, but not why. I can't find any information about logging within the Service Bus Queue client.

Where is the documentation? The MSDN in this instance is awful! It lacks even basic information about how these classes are supposed to work.

EDIT: As MaDeRkAn helpfully mentioned in a comment, the documentation for "SessionLockLostException" does mention that Azure can move around messages between partitions.

When I originally created a test application to see if this approach worked I had the queue configured to use partitions. While figuring out the code needed to handle the various exceptions that occur in various situations I read about that exception.

I have discounted this as being the problem for two reasons:

  1. I've (literally) triple checked that Partitions are disabled. I also checked that the Queue we're using is the same Queue I'm looking at for the properties.
  2. If Azure was causing failures this often (every 2-5 messages) then the service would be pretty much unusable! And while Azure has issues at times it's not normally totally broken like that.
  • 1
    I think there is no problem on AutoRenew. You can check [here](https://msdn.microsoft.com/tr-tr/library/azure/microsoft.servicebus.messaging.sessionlocklostexception.aspx) But it says this can be happen in partioned queue but your partion is false. Can you check your queue properties ? – Erkan Demirel Feb 16 '16 at 14:59
  • It's a good suggestion, but we've already ruled it out. I've checked that setting three times (the third time being just now) and it's definitely set to false/no. If it were Azure moving the messages between partitions then they'd have to be doing it constantly (we get this issue once every few messages) and it would be "unusable"! Thank you for the suggestion, and I appreciate you taking the time to look at this. I'll improve the question by adding this information. –  Feb 16 '16 at 15:15
  • Could you share your code for retrieving messages? – Chris Pietschmann Mar 17 '16 at 21:44

0 Answers0