Class TimeoutUnitOfWorkFactoryConfigurationEnhancer
java.lang.Object
org.axonframework.messaging.core.timeout.TimeoutUnitOfWorkFactoryConfigurationEnhancer
- All Implemented Interfaces:
ConfigurationEnhancer
@RegistrationScope("Register the decorators for the named CommandBus/QueryBus UnitOfWorkFactory components and the EventProcessorCustomization decorator once at the root; do not re-invoke in child module registries. CommandBus, QueryBus, and EventProcessorCustomization are all single, top-level components, never re-resolved per module, so re-invoking this enhancer per module would register redundant, unused decorators in registries that never consult them.")
public class TimeoutUnitOfWorkFactoryConfigurationEnhancer
extends Object
implements ConfigurationEnhancer
A
ConfigurationEnhancer that decorates the UnitOfWorkFactory used by the CommandBus,
QueryBus, and every event processor, so every UnitOfWork it creates has a timeout, based on the
TimeoutUnitOfWorkFactoryConfiguration present in the Configuration.
Automatically registers a TimeoutUnitOfWorkFactoryConfiguration.DEFAULT
TimeoutUnitOfWorkFactoryConfiguration when none is present yet.
- Since:
- 5.4.0
- Author:
- Steven van Beelen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe order ofthisenhancer compared to others, equal toMessagingConfigurationDefaults.ENHANCER_ORDERminus 10. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenhance(ComponentRegistry registry) intorder()Returns the relative order this enhancer should be invoked in, compared to other instances.
-
Field Details
-
ENHANCER_ORDER
public static final int ENHANCER_ORDERThe order ofthisenhancer compared to others, equal toMessagingConfigurationDefaults.ENHANCER_ORDERminus 10.This value ensures the
EventProcessorCustomizationdecorator set by this enhancer composes after any default customization set by theMessagingConfigurationDefaults, still leaving some room for customization by the user.- See Also:
-
-
Constructor Details
-
TimeoutUnitOfWorkFactoryConfigurationEnhancer
public TimeoutUnitOfWorkFactoryConfigurationEnhancer()
-
-
Method Details
-
enhance
Description copied from interface:ConfigurationEnhancer- Specified by:
enhancein interfaceConfigurationEnhancer- Parameters:
registry- The registry instance to enhance.
-
order
public int order()Description copied from interface:ConfigurationEnhancerReturns the relative order this enhancer should be invoked in, compared to other instances.Use lower (negative) values for enhancers providing sensible defaults, and higher values for enhancers that should be able to override values potentially previously set. Defaults to
0when not set.- Specified by:
orderin interfaceConfigurationEnhancer- Returns:
- The order in which this enhancer should be invoked.
-