Class MessageHandlerOptions


  • public final class MessageHandlerOptions
    extends Object
    The OnMessage handler processing options.
    • Constructor Detail

      • 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 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.