SessionHandlerOptions Class
- java.
lang. Object - com.
microsoft. azure. servicebus. SessionHandlerOptions
- com.
public final class SessionHandlerOptions
The OnSession handler processing options.
Constructor Summary
Constructor | Description | |
---|---|---|
SessionHandlerOptions() |
Default constructor with default values Default getMaxConcurrentSessions() is 1 Default getMaxConcurrentCallsPerSession() is 1 Default getMaxAutoRenewDuration() is 5 minutes Default isAutoComplete() is true. |
|
SessionHandlerOptions(int maxConcurrentSessions, boolean autoComplete, Duration maxAutoRenewDuration) | ||
SessionHandlerOptions(int maxConcurrentSessions, int maxConcurrentCallsPerSession, boolean autoComplete, Duration maxAutoRenewDuration) | ||
SessionHandlerOptions(int maxConcurrentSessions, int maxConcurrentCallsPerSession, boolean autoComplete, Duration maxAutoRenewDuration, Duration messageWaitDuration) |
Method Summary
Modifier and Type | Method and Description |
---|---|
Duration |
getMaxAutoRenewDuration()
Gets the maximum duration within which the lock will be renewed automatically. |
int |
getMaxConcurrentCallsPerSession()
Gets the maximum number of concurrent calls to the callback the message pump should initiate for each session. |
int |
getMaxConcurrentSessions()
Gets the maximum number of concurrent sessions that the pump should initiate. |
Duration |
getMessageWaitDuration()
Gets the time to wait for receiving a message. |
boolean |
isAutoComplete()
Whether the auto complete is set to true. |
String | toString() |
Methods inherited from java.lang.Object
Constructor Details
SessionHandlerOptions
public SessionHandlerOptions()
Default constructor with default values Default getMaxConcurrentSessions() is 1 Default getMaxConcurrentCallsPerSession() is 1 Default getMaxAutoRenewDuration() is 5 minutes Default isAutoComplete() is true. Default getMessageWaitDuration() is 1 minute
SessionHandlerOptions
public SessionHandlerOptions(int maxConcurrentSessions, boolean autoComplete, Duration maxAutoRenewDuration)
Parameters:
- Maximum duration within which the client keeps renewing the session lock if the processing of the session messages or onclose action is not completed by the handler.
SessionHandlerOptions
public SessionHandlerOptions(int maxConcurrentSessions, int maxConcurrentCallsPerSession, boolean autoComplete, Duration maxAutoRenewDuration)
Parameters:
SessionHandlerOptions
public SessionHandlerOptions(int maxConcurrentSessions, int maxConcurrentCallsPerSession, boolean autoComplete, Duration maxAutoRenewDuration, Duration messageWaitDuration)
Parameters:
Method Details
getMaxAutoRenewDuration
public Duration getMaxAutoRenewDuration()
Gets the maximum duration within which the lock will be renewed automatically. This value should be greater than the longest message lock duration; for example, the LockDuration Property. If a session lock is going to expire, this value is the max duration for the session lock to be automatically renewed.
Returns:
getMaxConcurrentCallsPerSession
public int getMaxConcurrentCallsPerSession()
Gets the maximum number of concurrent calls to the callback the message pump should initiate for each session.
Returns:
getMaxConcurrentSessions
public int getMaxConcurrentSessions()
Gets the maximum number of concurrent sessions that the pump should initiate. Setting this value to be greater than the max number of active sessions in the service will not increase message throughput. The session-pump (SDK) will accept MaxConcurrentSessions number of sessions in parallel and dispatch the messages. The messages within a session are delivered sequentially. If more than MaxConcurrentSessions number of sessions are present in the entity, they will be accepted one-by-one after closing the existing sessions.
Returns:
getMessageWaitDuration
public Duration getMessageWaitDuration()
Gets the time to wait for receiving a message. This is the time the session-pump waits before closing down the current session and switching to a different session. This value has an impact on the message throughput. If the value is very large, then every time the SDK waits for this duration before closing to make sure that all the messages have been received. If users are having a lot of sessions and fewer messages per session, try setting this to be a relative smaller value based on how frequent new messages arrive in the session.
Returns:
isAutoComplete
public boolean isAutoComplete()
Whether the auto complete is set to true. If this value is true, if the handler returns without any failure, then the message is completed and will not show up in the session; if any exception is thrown from the handler, the message is abandoned and the DeliveryCount of this message will increase by one. If this value is false, if the handler returns without any failure, then user has to write the logic to explicitly complete the message, otherwise the message is not considered 'completed' and will reappear in the session.
Returns:
toString
public String toString()
Overrides:
SessionHandlerOptions.toString()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