Package com.microsoft.azure.servicebus
Class MessageHandlerOptions
- java.lang.Object
-
- com.microsoft.azure.servicebus.MessageHandlerOptions
-
public final class MessageHandlerOptions extends Object
The OnMessage handler processing options.
-
-
Constructor Summary
Constructors Constructor Description MessageHandlerOptions()
Default constructor for createMessageHandlerOptions
with default settings.MessageHandlerOptions(int maxConcurrentCalls, boolean autoComplete, Duration maxAutoRenewDuration)
Create a instance ofMessageHandlerOptions
.MessageHandlerOptions(int maxConcurrentCalls, boolean autoComplete, Duration maxAutoRenewDuration, Duration messageWaitDuration)
Create a instance ofMessageHandlerOptions
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Duration
getMaxAutoRenewDuration()
Gets the maximum duration within which the lock will be renewed automatically.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.boolean
isAutoComplete()
Whether the auto complete is set to true.String
toString()
-
-
-
Constructor Detail
-
MessageHandlerOptions
public MessageHandlerOptions()
Default constructor for createMessageHandlerOptions
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 ofMessageHandlerOptions
.- Parameters:
maxConcurrentCalls
- maximum number of concurrent calls to the onMessage handlerautoComplete
- 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 ofMessageHandlerOptions
.- Parameters:
maxConcurrentCalls
- maximum number of concurrent calls to the onMessage handlerautoComplete
- 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 Detail
-
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.
-
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.
-
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.
-
getMessageWaitDuration
public Duration getMessageWaitDuration()
Gets the time to wait for receiving a message. Defaults to 1 minute.- Returns:
- The wait duration for receive calls.
-
-