Windows Azure MessageLockLostException

ⅰ亾dé卋堺 提交于 2019-12-10 03:16:57

问题


I'm having issues with Azure Message Bus Queues.

I'm having MessageLockLostException thrown and The request operation did not complete within the allotted timeout of 00:01:10. The time allotted to this operation may have been a portion of a longer timeout.

I've set my queue into ReceiveMode.PeekLock.

I also check

if(message.LockedUntilUtc.Minute <= 1)
    message.RenewLock();

Why would this happen, what's causing the lock to give out? I was reading somewhere from the point where you Receive you have 5 minutes by default. This process takes a little longer usually. I wanted to renew the lock but this isn't working too well.


回答1:


The LockDuration is property of the Queue. You typically set this when you create the Queue. This is Queue level property and cannot be changed on a message base. What you've read, most probably is saying that this duration cannot be longer than 5 minutes. The default value is 1 Minute, that's why you face issues. And why you face it 70 seconds later - I assume the logic for checking this conditions is executed every 10 seconds.

So I suggest that you create or modify your Queue to set LockDuration property to 5 minutes. Then, while working RenewLock of your message when appropriate.



来源:https://stackoverflow.com/questions/15303711/windows-azure-messagelocklostexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!