Class EventProcessorConfiguration
- All Implemented Interfaces:
DescribableComponent
- Direct Known Subclasses:
PooledStreamingEventProcessorConfiguration,SubscribingEventProcessorConfiguration
EventProcessor implementations.
The ErrorHandler is defaulted to a PropagatingErrorHandler and the UnitOfWorkFactory defaults
to the SimpleUnitOfWorkFactory
- Since:
- 5.0.0
- Author:
- Mateusz Nowak
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ErrorHandlerprotected List<MessageHandlerInterceptor<? super EventMessage>> protected MessageMonitor<? super EventMessage> protected UnitOfWorkFactory -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newEventProcessorConfigurationwith just default values.EventProcessorConfiguration(Configuration configuration) Constructs a newEventProcessorConfigurationwith default values and retrieve global default values.Constructs a newEventProcessorConfigurationcopying properties from the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoiddescribeTo(ComponentDescriptor descriptor) Describe the properties ofthis DescribableComponentwith the givendescriptor.Returns theErrorHandlerinvoked when anUnitOfWorkthrows an exception during processing.errorHandler(ErrorHandler errorHandler) Sets theErrorHandlerinvoked when anUnitOfWorkthrows an exception during processing.List<MessageHandlerInterceptor<? super EventMessage>> Returns the list ofEventMessage-specificMessageHandlerInterceptorsto add to theEventProcessorunder construction with this configuration implementation.booleanReturns whether this configuration is for a streaming event processor.Returns theUnitOfWorkFactoryused to createUnitOfWorkinstances for event processing.unitOfWorkFactory(UnitOfWorkFactory unitOfWorkFactory) AUnitOfWorkFactorythat spawnsUnitOfWorkused to process an event batch.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Field Details
-
errorHandler
-
messageMonitor
-
unitOfWorkFactory
-
interceptors
-
-
Constructor Details
-
EventProcessorConfiguration
Constructs a newEventProcessorConfigurationwith just default values. Do not retrieve any global default values. -
EventProcessorConfiguration
Constructs a newEventProcessorConfigurationwith default values and retrieve global default values.- Parameters:
configuration- The configuration, used to retrieve global default values, likeMessageHandlerInterceptors, from.
-
EventProcessorConfiguration
Constructs a newEventProcessorConfigurationcopying properties from the given configuration.- Parameters:
base- TheEventProcessorConfigurationto copy properties from.
-
-
Method Details
-
errorHandler
Sets theErrorHandlerinvoked when anUnitOfWorkthrows an exception during processing. Defaults to aPropagatingErrorHandler.- Parameters:
errorHandler- theErrorHandlerinvoked when anUnitOfWorkthrows an exception during processing- Returns:
- The current instance, for fluent interfacing.
-
unitOfWorkFactory
AUnitOfWorkFactorythat spawnsUnitOfWorkused to process an event batch.- Parameters:
unitOfWorkFactory- AUnitOfWorkFactorythat spawnsUnitOfWork.- Returns:
- The current instance, for fluent interfacing.
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-
errorHandler
Returns theErrorHandlerinvoked when anUnitOfWorkthrows an exception during processing.- Returns:
- The
ErrorHandlerfor thisEventProcessorimplementation.
-
unitOfWorkFactory
Returns theUnitOfWorkFactoryused to createUnitOfWorkinstances for event processing.- Returns:
- The
UnitOfWorkFactoryfor thisEventProcessorimplementation.
-
interceptors
Returns the list ofEventMessage-specificMessageHandlerInterceptorsto add to theEventProcessorunder construction with this configuration implementation.- Returns:
- The list of
EventMessage-specificMessageHandlerInterceptorsto add to theEventProcessorunder construction with this configuration implementation.
-
streaming
public boolean streaming()Returns whether this configuration is for a streaming event processor.- Returns:
falsefor basic configuration,truefor streaming configurations.
-
describeTo
Description copied from interface:DescribableComponentDescribe the properties ofthis DescribableComponentwith the givendescriptor.Components should call the appropriate
describePropertymethods on the descriptor to register their properties. The descriptor is responsible for determining how these properties are formatted and structured in the final output.Best Practices: As a general rule, all relevant fields of a
DescribableComponentimplementation should be described in this method. However, developers have discretion to include only the fields that make sense in the context. Not every field may be meaningful for description purposes, especially internal implementation details. Furthermore, components might want to expose different information based on their current state. The final decision on what properties to include lies with the person implementing thedescribeTomethod, who should focus on providing information that is useful for understanding the component's configuration and state.Example implementation:
public void describeTo(ComponentDescriptor descriptor) { descriptor.describeProperty("name", this.name); descriptor.describeProperty("enabled", this.enabled); descriptor.describeProperty("configuration", this.configuration); // A nested component descriptor.describeProperty("handlers", this.eventHandlers); // A collection }- Specified by:
describeToin interfaceDescribableComponent- Parameters:
descriptor- The component descriptor to describethis DescribableComponentn its properties in.
-