Class TimeoutUnitOfWorkFactoryConfiguration
java.lang.Object
org.axonframework.messaging.core.timeout.TimeoutUnitOfWorkFactoryConfiguration
Configuration for the timeout settings of an entire
ProcessingContext, per bus or event processor.
Unlike HandlerTimeoutConfiguration, which times out an individual message handler invocation, these settings
time out the full processing duration of a command bus, a query bus, or an event processor, including any work
performed by other interceptors and the commit of the ProcessingContext itself.
- Since:
- 5.4.0
- Author:
- Steven van Beelen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TimeoutUnitOfWorkFactoryConfigurationTheTimeoutUnitOfWorkFactoryConfigurationapplied when no otherTimeoutUnitOfWorkFactoryConfigurationcomponent is registered, giving the command bus, query bus, and event processors alike a 60-second timeout, a 10-second warning threshold, and a 1-second warning interval, with no per-processor overrides.static final TimeoutUnitOfWorkFactoryConfigurationTimeoutUnitOfWorkFactoryConfigurationthat disablesUnitOfWorkFactory-specific timeout behavior. -
Constructor Summary
ConstructorsConstructorDescriptionTimeoutUnitOfWorkFactoryConfiguration(TaskTimeoutSettings commandBus, TaskTimeoutSettings queryBus, TaskTimeoutSettings eventProcessors, Map<String, TaskTimeoutSettings> eventProcessor) Creates a newTimeoutUnitOfWorkFactoryConfigurationwith the given timeout settings. -
Method Summary
Modifier and TypeMethodDescriptioneventProcessorSettings(@Nullable String processorName) Retrieves the timeout settings for the event processor with the givenprocessorName, falling back togetEventProcessors()when no specific settings are registered for that name, or whenprocessorNameisnull.Retrieves the timeout settings for the command bus.Retrieves the timeout settings for specific, named event processors, keyed by processor name.Retrieves the timeout settings for event processors not present ingetEventProcessor().Retrieves the timeout settings for the query bus.
-
Field Details
-
DEFAULT
TheTimeoutUnitOfWorkFactoryConfigurationapplied when no otherTimeoutUnitOfWorkFactoryConfigurationcomponent is registered, giving the command bus, query bus, and event processors alike a 60-second timeout, a 10-second warning threshold, and a 1-second warning interval, with no per-processor overrides.These match the defaults Spring Boot auto-configuration applies through
TimeoutProperties, so unit-of-work-level timeout behavior is enabled out of the box regardless of whether an application uses Spring Boot. Construct aTimeoutUnitOfWorkFactoryConfigurationexplicitly, or use this constant to disable the configuration. -
DISABLED
TimeoutUnitOfWorkFactoryConfigurationthat disablesUnitOfWorkFactory-specific timeout behavior.
-
-
Constructor Details
-
TimeoutUnitOfWorkFactoryConfiguration
public TimeoutUnitOfWorkFactoryConfiguration(TaskTimeoutSettings commandBus, TaskTimeoutSettings queryBus, TaskTimeoutSettings eventProcessors, Map<String, TaskTimeoutSettings> eventProcessor) Creates a newTimeoutUnitOfWorkFactoryConfigurationwith the given timeout settings.- Parameters:
commandBus- the timeout settings for the command busqueryBus- the timeout settings for the query buseventProcessors- the timeout settings for event processors not present in the giveneventProcessormapeventProcessor- the timeout settings for specific, named event processors, keyed by processor name
-
-
Method Details
-
getCommandBus
Retrieves the timeout settings for the command bus.- Returns:
- the timeout settings for the command bus
-
getQueryBus
Retrieves the timeout settings for the query bus.- Returns:
- the timeout settings for the query bus
-
getEventProcessors
Retrieves the timeout settings for event processors not present ingetEventProcessor().- Returns:
- the default timeout settings for event processors
-
getEventProcessor
Retrieves the timeout settings for specific, named event processors, keyed by processor name.- Returns:
- the timeout settings for specific, named event processors
-
eventProcessorSettings
Retrieves the timeout settings for the event processor with the givenprocessorName, falling back togetEventProcessors()when no specific settings are registered for that name, or whenprocessorNameisnull.- Parameters:
processorName- the name of the event processor to retrieve timeout settings for, may benull- Returns:
- the timeout settings for the given
processorName
-