SessionHandlerOptions Class

  • java.lang.Object
    • com.microsoft.azure.servicebus.SessionHandlerOptions

public 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. Default getMessageWaitDuration() is 1 minute

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. This value should be greater than the longest message lock duration; for example, the LockDuration Property.

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. Defaults to 1 minute.

boolean isAutoComplete()

Whether the auto complete is set to true.

String toString()

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:

maxConcurrentSessions - maximum number of concurrent sessions accepted by the session pump
autoComplete - true if the pump should automatically complete message after onMessageHandler action is completed. false otherwise.
maxAutoRenewDuration - - 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:

maxConcurrentSessions - maximum number of concurrent sessions accepted by the session pump
maxConcurrentCallsPerSession - maximum number of concurrent calls to the onMessage handler
autoComplete - true if the pump should automatically complete message after onMessageHandler action is completed. false otherwise
maxAutoRenewDuration - 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, Duration messageWaitDuration)

Parameters:

maxConcurrentSessions - maximum number of concurrent sessions accepted by the session pump
maxConcurrentCallsPerSession - maximum number of concurrent calls to the onMessage handler
autoComplete - true if the pump should automatically complete message after onMessageHandler action is completed. false otherwise
maxAutoRenewDuration - 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.
messageWaitDuration - Duration to wait for receiving the message

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.

Returns:

The maximum duration during which locks are automatically renewed.

getMaxConcurrentCallsPerSession

public int getMaxConcurrentCallsPerSession()

Gets the maximum number of concurrent calls to the callback the message pump should initiate for each session.

Returns:

The maximum number of concurrent calls to the callback.

getMaxConcurrentSessions

public int getMaxConcurrentSessions()

Gets the maximum number of concurrent sessions that the pump should initiate.

Returns:

The maximum number of concurrent sessions

getMessageWaitDuration

public Duration getMessageWaitDuration()

Gets the time to wait for receiving a message. Defaults to 1 minute.

Returns:

The wait duration for receive calls.

isAutoComplete

public boolean isAutoComplete()

Whether the auto complete is set to true.

Returns:

true to complete the message processing automatically on successful execution of the operation; otherwise, false.

toString

public String toString()

Applies to