Class HandlerTimeoutHandlerEnhancerDefinition

java.lang.Object
org.axonframework.messaging.core.timeout.HandlerTimeoutHandlerEnhancerDefinition
All Implemented Interfaces:
HandlerEnhancerDefinition

public class HandlerTimeoutHandlerEnhancerDefinition extends Object implements HandlerEnhancerDefinition
Inspects message handler and wraps it in a TimeoutWrappedMessageHandlingMember if the handler should have a timeout.

The timeout is determined by the HandlerTimeoutConfiguration and the MessageHandlerTimeout annotation on the message handler method. The annotation takes precedence over the configuration.

Since:
4.11.0
Author:
Mitchell Herrijgers
See Also:
  • Constructor Details

    • HandlerTimeoutHandlerEnhancerDefinition

      public HandlerTimeoutHandlerEnhancerDefinition(HandlerTimeoutConfiguration configuration, ScheduledExecutorService executorService)
      Creates a new HandlerTimeoutHandlerEnhancerDefinition with the given configuration.

      Warnings and the timeout will be scheduled on the given executorService, which is strongly recommended to be the ScheduledExecutorService provided by the AxonTaskJanitor to ensure a single executor is used throughout.

      The configuration will be used as default, but can be overridden by the MessageHandlerTimeout annotation for individual message handlers.

      Parameters:
      configuration - the configuration for the timeout settings
      executorService - the executor service to schedule the timeout and warnings
  • Method Details