public interface EventProcessingConfigurer
Modifier and Type | Interface and Description |
---|---|
static interface |
EventProcessingConfigurer.DeadLetteringInvokerConfiguration
Contract defining
DeadLetteringEventHandlerInvoker.Builder based configuration when constructing a
DeadLetteringEventHandlerInvoker . |
static interface |
EventProcessingConfigurer.EventProcessorBuilder
Contract which defines how to build an event processor.
|
static interface |
EventProcessingConfigurer.PooledStreamingProcessorConfiguration
Contract defining
PooledStreamingEventProcessor.Builder based configuration when constructing a PooledStreamingEventProcessor . |
default <T> EventProcessingConfigurer registerSaga(Class<T> sagaType)
T
- the type of SagasagaType
- the type of SagaEventProcessingConfigurer
instance, for fluent interfacing<T> EventProcessingConfigurer registerSaga(Class<T> sagaType, Consumer<SagaConfigurer<T>> sagaConfigurer)
T
- The type of Saga to configuresagaType
- The type of Saga to configuresagaConfigurer
- a function providing modifications on top of the defaul configurationEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerSagaStore(Function<Configuration,SagaStore> sagaStoreBuilder)
sagaStoreBuilder
- a Function
that builds a SagaStore
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerEventHandler(Function<Configuration,Object> eventHandlerBuilder)
Function
that builds an Event Handler instance.eventHandlerBuilder
- a Function
that builds an Event Handler instanceEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerDefaultListenerInvocationErrorHandler(Function<Configuration,ListenerInvocationErrorHandler> listenerInvocationErrorHandlerBuilder)
Function
that builds the default ListenerInvocationErrorHandler
.
Defaults to a LoggingErrorHandler
.listenerInvocationErrorHandlerBuilder
- a Function
that builds the default
ListenerInvocationErrorHandler
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerListenerInvocationErrorHandler(String processingGroup, Function<Configuration,ListenerInvocationErrorHandler> listenerInvocationErrorHandlerBuilder)
processingGroup
- a String
specifying the name of a processing grouplistenerInvocationErrorHandlerBuilder
- a Function
that builds ListenerInvocationErrorHandler
EventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer registerTrackingEventProcessor(String name)
TrackingEventProcessor
with given name
within this
Configurer.name
- a String
specifying the name of the TrackingEventProcessor
being registeredEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer configureDefaultStreamableMessageSource(Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> defaultSource)
StreamableMessageSource
to use for Tracking Event Processors if none was explicitly
provided. Defaults to the Event Bus (or Store) available in the Configuration.
Note that the configuration of a default source does not change how the decision is made to select the
type of processor. Unless explicitly specified using usingSubscribingEventProcessors()
or
usingTrackingEventProcessors()
, the default is dependent on the type of Message Source the Event Bus
provides. If the Event Bus supports Tracking Processors, that is the default, otherwise Subscribing Event
Processors are the default.
defaultSource
- a Function that defines the Message source to useEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer configureDefaultSubscribableMessageSource(Function<Configuration,SubscribableMessageSource<EventMessage<?>>> defaultSource)
SubscribableMessageSource
to use for Subscribing Event Processors if none was explicitly
provided. Defaults to the Event Bus (or Store) available in the Configuration.
Note that the configuration of a default source does not change how the decision is made to select the
type of processor. Unless explicitly specified using usingSubscribingEventProcessors()
or
usingTrackingEventProcessors()
, the default is dependent on the type of Message Source the Event Bus
provides. If the Event Bus supports Tracking Processors, that is the default, otherwise Subscribing Event
Processors are the default.
defaultSource
- a Function that defines the Message source to useEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerTrackingEventProcessor(String name, Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> source)
name
- a String
specifying the name of the TrackingEventProcessor
being registeredsource
- a Function
that builds a StreamableMessageSource
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerTrackingEventProcessor(String name, Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> source, Function<Configuration,TrackingEventProcessorConfiguration> processorConfiguration)
TrackingEventProcessor
with given name
, source
and processorConfiguration
within this Configurer.name
- a String
specifying the name of the TrackingEventProcessor
being registeredsource
- a Function
that builds StreamableMessageSource
processorConfiguration
- a Function
that builds a TrackingEventProcessorConfiguration
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerEventProcessorFactory(EventProcessingConfigurer.EventProcessorBuilder eventProcessorBuilder)
EventProcessor
. This is the EventProcessingConfigurer.EventProcessorBuilder
to
be used when there is no specific builder for given processor name.eventProcessorBuilder
- a Function
that builds an EventProcessor
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerEventProcessor(String name, EventProcessingConfigurer.EventProcessorBuilder eventProcessorBuilder)
EventProcessingConfigurer.EventProcessorBuilder
for the given processor name
.name
- a String
specifying the name of the EventProcessor
being registeredeventProcessorBuilder
- a Function
that builds an EventProcessor
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerTokenStore(String processorName, Function<Configuration,TokenStore> tokenStoreBuilder)
processorName
- a String
specifying the name of a event processortokenStoreBuilder
- a Function
that builds a TokenStore
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerTokenStore(Function<Configuration,TokenStore> tokenStore)
Function
that builds a TokenStore
to use as the default in case no explicit token
store was configured for a processor.tokenStore
- a Function
that builds a TokenStore
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer usingSubscribingEventProcessors()
SubscribingEventProcessor
.
The default behavior depends on the EventBus available in the Configuration. If the Event Bus is a
StreamableMessageSource
, processors are Tracking by default. This method must be used to force the use
of Subscribing Processors, unless specifically overridden for individual processors.
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer usingTrackingEventProcessors()
TrackingEventProcessor
.
The default behavior depends on the EventBus available in the Configuration. If the Event Bus is a
StreamableMessageSource
, processors are Tracking by default. This method must be used to force the use
of Tracking Processors, unless specifically overridden for individual processors.
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer usingPooledStreamingEventProcessors()
PooledStreamingEventProcessor
.
The default behavior depends on the EventBus
available in the Configuration
. If the EventBus
is a StreamableMessageSource
, processors are Tracking by default. This method must be used to
force the use of Pooled Streaming Processors, unless specifically overridden for individual processors.
EventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer usingPooledStreamingEventProcessors(EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration)
PooledStreamingEventProcessor
using the
configuration
to configure them.
The default behavior depends on the EventBus
available in the Configuration
. If the
EventBus
is a StreamableMessageSource
, processors are Tracking by default. This method must be
used to force the use of Pooled Streaming Processors, unless specifically overridden for individual processors.
pooledStreamingProcessorConfiguration
- configuration used when constructing every
PooledStreamingEventProcessor
EventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer registerSubscribingEventProcessor(String name)
SubscribingEventProcessor
with given name
within this
Configurer.name
- a String
specyfing the name of the SubscribingEventProcessor
being registeredEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerSubscribingEventProcessor(String name, Function<Configuration,SubscribableMessageSource<? extends EventMessage<?>>> messageSource)
name
- a String
specyfing the name of the SubscribingEventProcessor
being registeredmessageSource
- a Function
that builds a SubscribableMessageSource
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerDefaultErrorHandler(Function<Configuration,ErrorHandler> errorHandlerBuilder)
errorHandlerBuilder
- a Function
that builds an ErrorHandler
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerErrorHandler(String eventProcessorName, Function<Configuration,ErrorHandler> errorHandlerBuilder)
eventProcessorName
- a String
specifying the name of an EventProcessor
errorHandlerBuilder
- a Function
that builds an ErrorHandler
EventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer byDefaultAssignTo(String processingGroup)
processingGroup
name to assign Event Handler and Saga beans to when no other, more
explicit, rule matches and no ProcessingGroup
annotation is found.processingGroup
- a String
specifying the name of a processing groupEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer byDefaultAssignHandlerInstancesTo(Function<Object,String> assignmentFunction)
Function
that defines the Event Processing Group name to assign Event Handler beans to when
no other, more explicit, rule matches and no ProcessingGroup
annotation is found.assignmentFunction
- a Function
that returns the Processing Group for each Event Handler beanEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer byDefaultAssignHandlerTypesTo(Function<Class<?>,String> assignmentFunction)
Function
that defines the Event Processing Group name to assign Event Handler and Saga beans
to when no other, more explicit, rule matches and no ProcessingGroup
annotation is found.assignmentFunction
- a Function
that returns the Processing Group for each Event Handler or Saga
beanEventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer assignHandlerInstancesMatching(String processingGroup, Predicate<Object> criteria)
criteria
to the Processing Group
with given name
, with neutral priority (value 0).
Note that, when beans match multiple criteria for different Processing Groups with equal priority, the outcome is undefined.
processingGroup
- a String
specifying the name of a processing group to assign matching Event
Handlers tocriteria
- a Predicate
defining the criteria for an Event Handler to matchEventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer assignHandlerTypesMatching(String processingGroup, Predicate<Class<?>> criteria)
criteria
to the Processing Group
with given name
, with neutral priority (value 0).
Note that, when beans match multiple criteria for different Processing Groups with equal priority, the outcome is undefined.
processingGroup
- a String
specifying the name of a processing group to assign matching Event
Handlers or Sagas tocriteria
- a Predicate
defining the criteria for an Event Handler or Saga to matchEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer assignHandlerInstancesMatching(String processingGroup, int priority, Predicate<Object> criteria)
criteria
to the Processing Group
with given name
, with given priority
. Rules with higher value of priority
take precedence
over those with a lower value.
Note that, when beans match multiple criteria for different processing groups with equal priority, the outcome is undefined.
processingGroup
- a String
specifying the name of a processing group to assign matching Event
Handlers topriority
- The priority for this rulecriteria
- a Predicate
defining the criteria for an Event Handler to matchEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer assignHandlerTypesMatching(String processingGroup, int priority, Predicate<Class<?>> criteria)
criteria
to the Processing Group
with given name
, with given priority
. Rules with higher value of priority
take precedence
over those with a lower value.
Note that, when beans match multiple criteria for different processing groups with equal priority, the outcome is undefined.
processingGroup
- a String
specifying the name of the Processing Group to assign matching Event
Handlers or Sagas topriority
- an int
specifying the priority of this rulecriteria
- a Predicate
defining the criteria for an Event Handler or Saga to matchEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer assignProcessingGroup(String processingGroup, String processorName)
processingGroup
- a String
specifying the processing group to be assignedprocessorName
- a String
specifying the processor name to assign the group toEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer assignProcessingGroup(Function<String,String> assignmentRule)
assignmentRule
- a Function
which takes a processing group and returns a processor nameEventProcessingConfigurer
instance, for fluent interfacingassignProcessingGroup(String, String)
EventProcessingConfigurer registerHandlerInterceptor(String processorName, Function<Configuration,MessageHandlerInterceptor<? super EventMessage<?>>> interceptorBuilder)
interceptorBuilder
to build a MessageHandlerInterceptor
for the
EventProcessor
with given processorName
.
The interceptorBuilder
may return null
, in which case the return value is ignored.
processorName
- a String
specyfing the name of the processor to register the
MessageHandlerInterceptor
oninterceptorBuilder
- a Function
providing the MessageHandlerInterceptor
to register, or
null
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerDefaultHandlerInterceptor(BiFunction<Configuration,String,MessageHandlerInterceptor<? super EventMessage<?>>> interceptorBuilder)
interceptorBuilder
as a default to build a MessageHandlerInterceptor
for
EventProcessor
s created in this configuration.
The interceptorBuilder
is invoked once for each processor created, and may return null
, in which
case the return value is ignored.
interceptorBuilder
- a builder Function
that provides a MessageHandlerInterceptor
for each
available processorEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerSequencingPolicy(String processingGroup, Function<Configuration,SequencingPolicy<? super EventMessage<?>>> policyBuilder)
SequencingPolicy
created by the given policyBuilder
to the processing group with
given processingGroup
. Any previously configured policy for the same name will be overwritten.processingGroup
- a String
specifying the name of the processing group to assign the
SequencingPolicy
forpolicyBuilder
- a builder Function
to create the SequencingPolicy
to useEventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerDefaultSequencingPolicy(Function<Configuration,SequencingPolicy<? super EventMessage<?>>> policyBuilder)
SequencingPolicy
created by given policyBuilder
to the processing groups for which
no explicit policy is defined (using registerSequencingPolicy(String, Function)
).
Defaults to a SequentialPerAggregatePolicy
.
policyBuilder
- a builder Function
to create the SequencingPolicy
to useEventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer registerMessageMonitor(String eventProcessorName, Function<Configuration,MessageMonitor<Message<?>>> messageMonitorBuilder)
eventProcessorName
- a String
specifying the name of an EventProcessor
messageMonitorBuilder
- a builder Function
to create a MessageMonitor
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerMessageMonitorFactory(String eventProcessorName, MessageMonitorFactory messageMonitorFactory)
eventProcessorName
- a String
specifying the name of an EventProcessor
messageMonitorFactory
- a MessageMonitorFactory
used to create a MessageMonitor
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerRollbackConfiguration(String name, Function<Configuration,RollbackConfiguration> rollbackConfigurationBuilder)
Function
that builds the RollbackConfiguration
for given processor name
.
Defaults to a RollbackConfigurationType.ANY_THROWABLE
name
- a String
specifying the name of an EventProcessor
rollbackConfigurationBuilder
- a Function
that builds a RollbackConfiguration
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerTransactionManager(String name, Function<Configuration,TransactionManager> transactionManagerBuilder)
name
- a String
specifying the name of an EventProcessor
transactionManagerBuilder
- a Function
that builds a TransactionManager
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerDefaultTransactionManager(Function<Configuration,TransactionManager> transactionManagerBuilder)
TransactionManager
for all EventProcessor
s. The provided TransactionManager
is used whenever no processor specific TransactionManager
is configured.transactionManagerBuilder
- a Function
that builds a TransactionManager
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerTrackingEventProcessorConfiguration(String name, Function<Configuration,TrackingEventProcessorConfiguration> trackingEventProcessorConfigurationBuilder)
Function
that builds a TrackingEventProcessorConfiguration
to be used by the EventProcessor
corresponding to the given name
.name
- a String
specifying the name of an EventProcessor
trackingEventProcessorConfigurationBuilder
- a Function
that builds a TrackingEventProcessorConfiguration
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerTrackingEventProcessorConfiguration(Function<Configuration,TrackingEventProcessorConfiguration> trackingEventProcessorConfigurationBuilder)
Function
that builds a TrackingEventProcessorConfiguration
to use as the default.trackingEventProcessorConfigurationBuilder
- a Function
that builds a TrackingEventProcessorConfiguration
EventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer registerPooledStreamingEventProcessor(String name)
PooledStreamingEventProcessor
in this EventProcessingConfigurer
. The processor will
receive the given name
.name
- the name of the PooledStreamingEventProcessor
being registeredEventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer registerPooledStreamingEventProcessor(String name, Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> messageSource)
PooledStreamingEventProcessor
in this EventProcessingConfigurer
. The processor will
receive the given name
and use the outcome of the messageSource
as the StreamableMessageSource
.name
- the name of the PooledStreamingEventProcessor
being registeredmessageSource
- constructs a StreamableMessageSource
to be used by the PooledStreamingEventProcessor
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerPooledStreamingEventProcessor(String name, Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> messageSource, EventProcessingConfigurer.PooledStreamingProcessorConfiguration processorConfiguration)
PooledStreamingEventProcessor
in this EventProcessingConfigurer
. The processor will
receive the given name
and use the outcome of the messageSource
as the StreamableMessageSource
.
The processorConfiguration
will be used to further configure the PooledStreamingEventProcessor
upon construction. Note that the processorConfiguration
will override any configuration set through the
registerPooledStreamingEventProcessorConfiguration(PooledStreamingProcessorConfiguration)
and registerPooledStreamingEventProcessorConfiguration(String, PooledStreamingProcessorConfiguration)
.
name
- the name of the PooledStreamingEventProcessor
being registeredmessageSource
- constructs a StreamableMessageSource
to be used by the PooledStreamingEventProcessor
processorConfiguration
- allows further customization of the PooledStreamingEventProcessor
under
construction. The given Configuration
can be used to extract components and
use them in the PooledStreamingEventProcessor.Builder
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerPooledStreamingEventProcessorConfiguration(EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration)
EventProcessingConfigurer.PooledStreamingProcessorConfiguration
to be used when constructing every PooledStreamingEventProcessor
.pooledStreamingProcessorConfiguration
- configuration used when constructing every PooledStreamingEventProcessor
EventProcessingConfigurer
instance, for fluent interfacingEventProcessingConfigurer registerPooledStreamingEventProcessorConfiguration(String name, EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration)
EventProcessingConfigurer.PooledStreamingProcessorConfiguration
to be used when constructing a PooledStreamingEventProcessor
with name
.name
- the name of an PooledStreamingEventProcessor
pooledStreamingProcessorConfiguration
- configuration used when constructing a PooledStreamingEventProcessor
with the given name
EventProcessingConfigurer
instance, for fluent interfacingdefault EventProcessingConfigurer registerDeadLetterQueue(@Nonnull String processingGroup, @Nonnull Function<Configuration,SequencedDeadLetterQueue<EventMessage<?>>> queueBuilder)
SequencedDeadLetterQueue
for the given processingGroup
. The
SequencedDeadLetterQueue
will automatically enqueue failed events and evaluate them per the queue's
configuration.processingGroup
- A String
specifying the name of the processing group to register the given
SequencedDeadLetterQueue
for.queueBuilder
- A builder method returning a SequencedDeadLetterQueue
based on a
Configuration
. The outcome is used by the given processingGroup
to enqueue
and evaluate failed events in.EventProcessingConfigurer
instance, for fluent interfacing.default EventProcessingConfigurer registerDefaultDeadLetterPolicy(@Nonnull Function<Configuration,EnqueuePolicy<EventMessage<?>>> policyBuilder)
dead letter policy
for any processing group using a
dead letter queue
. The processing group uses the policy to
deduce whether a failed EventMessage
should be
enqueued
for later evaluation.
Note that the configured component will not be used if the processing group does not have a dead letter queue.
policyBuilder
- A builder method to construct a default dead letter policy
.EventProcessingConfigurer
instance, for fluent interfacing.default EventProcessingConfigurer registerDeadLetterPolicy(@Nonnull String processingGroup, @Nonnull Function<Configuration,EnqueuePolicy<EventMessage<?>>> policyBuilder)
dead letter policy
for the given processingGroup
using a
dead letter queue
. The processing group uses the policy to
deduce whether a failed EventMessage
should be
enqueued
for later evaluation.
Note that the configured component will not be used if the processing group does not have a dead letter queue.
processingGroup
- The name of the processing group to build an EnqueuePolicy
for.policyBuilder
- A builder method to construct a dead letter policy
for the given
processingGroup
.EventProcessingConfigurer
instance, for fluent interfacing.default EventProcessingConfigurer registerDeadLetteringEventHandlerInvokerConfiguration(@Nonnull String processingGroup, @Nonnull EventProcessingConfigurer.DeadLetteringInvokerConfiguration configuration)
EventProcessingConfigurer.DeadLetteringInvokerConfiguration
for the given processingGroup
. This configuration
object allows for fine-grained customization of a
dead lettering processing group
through its
builder
.
Note that the configured component will not be used if the processing group does not have a dead letter queue.
processingGroup
- The name of the processing group to attach additional configuration too.configuration
- The additional configuration for the dead lettering processing group.EventProcessingConfigurer
instance, for fluent interfacing.Copyright © 2010–2023. All rights reserved.