ServiceBusSessionReceiver.SessionLockToken Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the session lock token assigned by the service when the session is locked non-exclusively, or null
when the session is locked exclusively (the default). Another receiver can present this token through
SessionLockToken, which takes it as a Guid, to
cooperatively take over the session.
public virtual string SessionLockToken { get; }
member this.SessionLockToken : string
Public Overridable ReadOnly Property SessionLockToken As String
Property Value
Remarks
The token is assigned by the service when the session is acquired, or when this receiver takes over a session by presenting an existing token, and this property reports that same value for the lifetime of this receiver. It is not cleared when another receiver takes the session over, so a non-null value reports the token this receiver was assigned rather than proof that this receiver still holds the session. A receiver that has been taken over surfaces SessionLockLost on its next operation.
This token authorizes taking over the session lock for any caller with Listen rights on the entity, so treat it as sensitive: do not log it, do not persist it unprotected, and transmit it only over a trusted channel.