共用方式為


ServiceBusSessionMessageActions.RenewSessionLockAsync Method

Definition

Renews the lock on the session specified by the SessionId. The lock will be renewed based on the setting specified on the entity.

public virtual System.Threading.Tasks.Task RenewSessionLockAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member RenewSessionLockAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.RenewSessionLockAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function RenewSessionLockAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

cancellationToken
CancellationToken

An optional CancellationToken instance to signal the request to cancel the operation.

Returns

Exceptions

The lock for the session has expired. The Reason will be set to SessionLockLost in this case.

Remarks

When you accept a session, the session is locked for this receiver by the service for a duration as specified during the Queue/Subscription creation. If processing of the session requires longer than this duration, the session-lock needs to be renewed. For each renewal, it resets the time the session is locked by the LockDuration set on the Entity.

Renewal of session renews all the messages in the session as well. Each individual message need not be renewed.

Applies to