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)

'Declaration
Public Sub RenewLock
'Usage
Dim instance As BrokeredMessage

instance.RenewLock()

ExceptionCondition
MessagingException

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

MessagingCommunicationException

You can retry the operation immediately.

MessageLockLostException

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

SessionLockLostException

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();
message.RenewLock()
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft