MessageSession Class
- java.
lang. Object - com.
microsoft. azure. servicebus. primitives. ClientEntity - com.
microsoft. azure. servicebus. InitializableEntity - com.
microsoft. azure. servicebus. MessageReceiver - com.
microsoft. azure. servicebus. MessageSession
- com.
- com.
- com.
- com.
Implements
public class MessageSession
extends com.microsoft.azure.servicebus.MessageReceiver
implements IMessageSession
Method Summary
Modifier and Type | Method and Description |
---|---|
Instant | getLockedUntilUtc() |
protected String | getRequestedSessionId() |
String | getSessionId() |
byte[] |
getState()
Gets the session state. |
Completable |
getStateAsync()
Asynchronously gets the session state. |
protected boolean | isBrowsableSession() |
protected final boolean | isSessionReceiver() |
void |
renewSessionLock()
Renews the lock on the session specified by the getSessionId(). |
Completable |
renewSessionLockAsync()
Renews the lock on the session specified by the getSessionId(). |
void |
setState(byte[] sessionState)
Set a custom state on the session which can be later retrieved using getState(). |
Completable |
setStateAsync(byte[] sessionState)
Asynchronously set a custom state on the session which can be later retrieved using getState(). |
Methods inherited from com.microsoft.azure.servicebus.MessageReceiver
Methods inherited from ClientEntity
Methods inherited from java.lang.Object
Method Details
getLockedUntilUtc
public Instant getLockedUntilUtc()
getRequestedSessionId
protected String getRequestedSessionId()
Overrides:
MessageSession.getRequestedSessionId()getSessionId
public String getSessionId()
getState
getStateAsync
public CompletableFuture
Asynchronously gets the session state.
isBrowsableSession
protected boolean isBrowsableSession()
Overrides:
MessageSession.isBrowsableSession()isSessionReceiver
protected final boolean isSessionReceiver()
Overrides:
MessageSession.isSessionReceiver()renewSessionLock
public void renewSessionLock()
Renews the lock on the session specified by the getSessionId(). The lock will be renewed based on the setting specified on the entity.
When you accept a session, the session is locked for this client instance 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, the session-lock is renewed by the entity's LockDuration.
Renewal of session renews all the messages in the session as well. Each individual message need not be renewed.
Throws:
renewSessionLockAsync
public CompletableFuture
Renews the lock on the session specified by the getSessionId(). The lock will be renewed based on the setting specified on the entity.
setState
public void setState(byte[] sessionState)
Set a custom state on the session which can be later retrieved using getState().
Parameters:
Throws:
setStateAsync
public CompletableFuture
Asynchronously set a custom state on the session which can be later retrieved using getState().
Parameters:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for