MessageHandlerOptions Class

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

public class MessageHandlerOptions

The OnMessage handler processing options.

Constructor Summary

Constructor Description
MessageHandlerOptions()

Default constructor for create MessageHandlerOptions with default settings. getMaxConcurrentCalls() default value is 1. getMaxAutoRenewDuration() default value is 5 minutes. isAutoComplete() default is true.

MessageHandlerOptions(int maxConcurrentCalls, boolean autoComplete, Duration maxAutoRenewDuration)

Create a instance of MessageHandlerOptions.

MessageHandlerOptions(int maxConcurrentCalls, boolean autoComplete, Duration maxAutoRenewDuration, Duration messageWaitDuration)

Create a instance of MessageHandlerOptions.

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 getMaxConcurrentCalls()

Gets the maximum number of concurrent calls to the callback the message 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

MessageHandlerOptions

public MessageHandlerOptions()

Default constructor for create MessageHandlerOptions with default settings. getMaxConcurrentCalls() default value is 1. getMaxAutoRenewDuration() default value is 5 minutes. isAutoComplete() default is true.

MessageHandlerOptions

public MessageHandlerOptions(int maxConcurrentCalls, boolean autoComplete, Duration maxAutoRenewDuration)

Create a instance of MessageHandlerOptions.

Parameters:

maxConcurrentCalls - 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 message lock if the processing of the message is not completed by the handler.

MessageHandlerOptions

public MessageHandlerOptions(int maxConcurrentCalls, boolean autoComplete, Duration maxAutoRenewDuration, Duration messageWaitDuration)

Create a instance of MessageHandlerOptions.

Parameters:

maxConcurrentCalls - 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 message lock if the processing of the message 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.

getMaxConcurrentCalls

public int getMaxConcurrentCalls()

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

Returns:

The maximum number of concurrent calls to the callback.

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