SALES: 1-800-867-1380

BrokeredMessage.RenewLock Method

Renews the lock on a message.

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

member RenewLock : unit -> unit 


If IsTransient is true, you can retry the operation immediately.


You can retry the operation immediately.


Thrown if you have called RenewLock() too late. In a session, this is never thrown.


Thrown instead of MessageLockLostException if the message is from a MessageSession.

RenewLock() enables long-running processing operations on messages. RenewLock updates the message lock by resetting the service side timer, and updates the LockedUntilUtc property once RenewLock completes. You can renew locks for the same duration as the entity lock timeout, and there is no maximum duration for a lock renewal.

RenewLock() always renews the message lock, regardless of whether it is from a session queue or not. To renew a session lock, use RenewLock() instead.

QueueClient queueClient = QueueClient.Create("myQ");
BrokeredMessage message = queueClient.Receive();
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft