Interface EventProcessingConfigurer
- All Known Implementing Classes:
EventProcessingModule
- Since:
- 4.0
- Author:
- Milan Savic
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceContract definingDeadLetteringEventHandlerInvoker.Builderbased configuration when constructing aDeadLetteringEventHandlerInvoker.static interfaceContract which defines how to build an event processor.static interfaceContract definingPooledStreamingEventProcessor.Builderbased configuration when constructing aPooledStreamingEventProcessor.static interfaceContract which define how to buildSubscribableMessageSourceDefinition -
Method Summary
Modifier and TypeMethodDescriptionassignHandlerInstancesMatching(String processingGroup, int priority, Predicate<Object> criteria) Configures a rule to assign Event Handler beans that match the givencriteriato the Processing Group with givenname, with givenpriority.default EventProcessingConfigurerassignHandlerInstancesMatching(String processingGroup, Predicate<Object> criteria) Configures a rule to assign Event Handler beans that match the givencriteriato the Processing Group with givenname, with neutral priority (value 0).assignHandlerTypesMatching(String processingGroup, int priority, Predicate<Class<?>> criteria) Configures a rule to assign Event Handler beans that match the givencriteriato the Processing Group with givenname, with givenpriority.default EventProcessingConfigurerassignHandlerTypesMatching(String processingGroup, Predicate<Class<?>> criteria) Configures a rule to assign Event Handler beans that match the givencriteriato the Processing Group with givenname, with neutral priority (value 0).assignProcessingGroup(String processingGroup, String processorName) Defines a mapping for assigning processing groups to processors.assignProcessingGroup(Function<String, String> assignmentRule) Defines a rule for assigning processing groups to processors if processing group to processor name mapping does not contain the entry.byDefaultAssignHandlerInstancesTo(Function<Object, String> assignmentFunction) Registers aFunctionthat defines the Event Processing Group name to assign Event Handler beans to when no other, more explicit, rule matches and noProcessingGroupannotation is found.byDefaultAssignHandlerTypesTo(Function<Class<?>, String> assignmentFunction) Registers aFunctionthat defines the Event Processing Group name to assign Event Handler and Saga beans to when no other, more explicit, rule matches and noProcessingGroupannotation is found.default EventProcessingConfigurerbyDefaultAssignTo(String processingGroup) Registers theprocessingGroupname to assign Event Handler and Saga beans to when no other, more explicit, rule matches and noProcessingGroupannotation is found.configureDefaultStreamableMessageSource(Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> defaultSource) Configures whichStreamableMessageSourceto use for Tracking Event Processors if none was explicitly provided.configureDefaultSubscribableMessageSource(Function<Configuration, SubscribableMessageSource<EventMessage<?>>> defaultSource) Configures whichSubscribableMessageSourceto use for Subscribing Event Processors if none was explicitly provided.default EventProcessingConfigurerregisterDeadLetteringEventHandlerInvokerConfiguration(String processingGroup, EventProcessingConfigurer.DeadLetteringInvokerConfiguration configuration) Register aEventProcessingConfigurer.DeadLetteringInvokerConfigurationfor the givenprocessingGroup.default EventProcessingConfigurerregisterDeadLetterPolicy(String processingGroup, Function<Configuration, EnqueuePolicy<EventMessage<?>>> policyBuilder) default EventProcessingConfigurerregisterDeadLetterQueue(String processingGroup, Function<Configuration, SequencedDeadLetterQueue<EventMessage<?>>> queueBuilder) Register aSequencedDeadLetterQueuefor the givenprocessingGroup.default EventProcessingConfigurerregisterDeadLetterQueueProvider(Function<String, Function<Configuration, SequencedDeadLetterQueue<EventMessage<?>>>> deadLetterQueueProvider) Register the givendeadLetterProvideras a default to build aSequencedDeadLetterQueueforEventProcessors created in this configuration.default EventProcessingConfigurerregisterDefaultDeadLetterPolicy(Function<Configuration, EnqueuePolicy<EventMessage<?>>> policyBuilder) Register a defaultdead letter policyfor any processing group using adead letter queue.registerDefaultErrorHandler(Function<Configuration, ErrorHandler> errorHandlerBuilder) Registers aFunctionthat builds the defaultErrorHandler.registerDefaultHandlerInterceptor(BiFunction<Configuration, String, MessageHandlerInterceptor<? super EventMessage<?>>> interceptorBuilder) Register the giveninterceptorBuilderas a default to build aMessageHandlerInterceptorforEventProcessors created in this configuration.registerDefaultListenerInvocationErrorHandler(Function<Configuration, ListenerInvocationErrorHandler> listenerInvocationErrorHandlerBuilder) Registers aFunctionthat builds the defaultListenerInvocationErrorHandler.registerDefaultSequencingPolicy(Function<Configuration, SequencingPolicy<? super EventMessage<?>>> policyBuilder) Registers theSequencingPolicycreated by givenpolicyBuilderto the processing groups for which no explicit policy is defined (usingregisterSequencingPolicy(String, Function)).registerDefaultTransactionManager(Function<Configuration, TransactionManager> transactionManagerBuilder) Registers a defaultTransactionManagerfor allEventProcessors.registerErrorHandler(String eventProcessorName, Function<Configuration, ErrorHandler> errorHandlerBuilder) registerEventHandler(Function<Configuration, Object> eventHandlerBuilder) Registers aFunctionthat builds an Event Handler instance.registerEventProcessor(String name, EventProcessingConfigurer.EventProcessorBuilder eventProcessorBuilder) Registers anEventProcessingConfigurer.EventProcessorBuilderfor the given processorname.registerEventProcessorFactory(EventProcessingConfigurer.EventProcessorBuilder eventProcessorBuilder) Registers a factory that builds the defaultEventProcessor.registerHandlerInterceptor(String processorName, Function<Configuration, MessageHandlerInterceptor<? super EventMessage<?>>> interceptorBuilder) Register the giveninterceptorBuilderto build aMessageHandlerInterceptorfor theEventProcessorwith givenprocessorName.registerListenerInvocationErrorHandler(String processingGroup, Function<Configuration, ListenerInvocationErrorHandler> listenerInvocationErrorHandlerBuilder) default EventProcessingConfigurerregisterMessageMonitor(String eventProcessorName, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) registerMessageMonitorFactory(String eventProcessorName, MessageMonitorFactory messageMonitorFactory) default EventProcessingConfigurerRegisters aPooledStreamingEventProcessorin thisEventProcessingConfigurer.default EventProcessingConfigurerregisterPooledStreamingEventProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> messageSource) Registers aPooledStreamingEventProcessorin thisEventProcessingConfigurer.registerPooledStreamingEventProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> messageSource, EventProcessingConfigurer.PooledStreamingProcessorConfiguration processorConfiguration) Registers aPooledStreamingEventProcessorin thisEventProcessingConfigurer.registerPooledStreamingEventProcessorConfiguration(String name, EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration) Register aEventProcessingConfigurer.PooledStreamingProcessorConfigurationto be used when constructing aPooledStreamingEventProcessorwithname.registerPooledStreamingEventProcessorConfiguration(EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration) Register a defaultEventProcessingConfigurer.PooledStreamingProcessorConfigurationto be used when constructing everyPooledStreamingEventProcessor.registerRollbackConfiguration(String name, Function<Configuration, RollbackConfiguration> rollbackConfigurationBuilder) default <T> EventProcessingConfigurerregisterSaga(Class<T> sagaType) Registers a Saga with default configuration within this Configurer.registerSaga(Class<T> sagaType, Consumer<SagaConfigurer<T>> sagaConfigurer) Registers a Saga, allowing specific configuration to use for this Saga type.registerSagaStore(Function<Configuration, SagaStore> sagaStoreBuilder) registerSequencingPolicy(String processingGroup, Function<Configuration, SequencingPolicy<? super EventMessage<?>>> policyBuilder) Registers theSequencingPolicycreated by the givenpolicyBuilderto the processing group with givenprocessingGroup.default EventProcessingConfigurerRegisters aSubscribingEventProcessorwith givennamewithin this Configurer.registerSubscribingEventProcessor(String name, Function<Configuration, SubscribableMessageSource<? extends EventMessage<?>>> messageSource) registerTokenStore(String processorName, Function<Configuration, TokenStore> tokenStoreBuilder) registerTokenStore(Function<Configuration, TokenStore> tokenStore) Register aFunctionthat builds aTokenStoreto use as the default in case no explicit token store was configured for a processor.default EventProcessingConfigurerRegisters aTrackingEventProcessorwith givennamewithin this Configurer.registerTrackingEventProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> source) registerTrackingEventProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> source, Function<Configuration, TrackingEventProcessorConfiguration> processorConfiguration) Registers aTrackingEventProcessorwith givenname,sourceandprocessorConfigurationwithin this Configurer.registerTrackingEventProcessorConfiguration(String name, Function<Configuration, TrackingEventProcessorConfiguration> trackingEventProcessorConfigurationBuilder) Register aFunctionthat builds aTrackingEventProcessorConfigurationto be used by theEventProcessorcorresponding to the givenname.registerTrackingEventProcessorConfiguration(Function<Configuration, TrackingEventProcessorConfiguration> trackingEventProcessorConfigurationBuilder) Register aFunctionthat builds aTrackingEventProcessorConfigurationto use as the default.registerTransactionManager(String name, Function<Configuration, TransactionManager> transactionManagerBuilder) Defaults Event Processors builders to usePooledStreamingEventProcessor.default EventProcessingConfigurerusingPooledStreamingEventProcessors(EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration) Defaults Event Processors builders to construct aPooledStreamingEventProcessorusing theconfigurationto configure them.Defaults Event Processors builders to useSubscribingEventProcessor.default EventProcessingConfigurerusingSubscribingEventProcessors(EventProcessingConfigurer.SubscribableMessageSourceDefinitionBuilder builder) If this method is invoked, Subscribing Event Processors will be created for all processing groups if none was explicitly provided.Defaults Event Processors builders to useTrackingEventProcessor.
-
Method Details
-
registerSaga
Registers a Saga with default configuration within this Configurer.- Type Parameters:
T- the type of Saga- Parameters:
sagaType- the type of Saga- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerSaga
<T> EventProcessingConfigurer registerSaga(Class<T> sagaType, Consumer<SagaConfigurer<T>> sagaConfigurer) Registers a Saga, allowing specific configuration to use for this Saga type.- Type Parameters:
T- The type of Saga to configure- Parameters:
sagaType- The type of Saga to configuresagaConfigurer- a function providing modifications on top of the default configuration- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerSagaStore
- Parameters:
sagaStoreBuilder- aFunctionthat builds aSagaStore- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerEventHandler
Registers aFunctionthat builds an Event Handler instance.- Parameters:
eventHandlerBuilder- aFunctionthat builds an Event Handler instance- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerDefaultListenerInvocationErrorHandler
EventProcessingConfigurer registerDefaultListenerInvocationErrorHandler(Function<Configuration, ListenerInvocationErrorHandler> listenerInvocationErrorHandlerBuilder) Registers aFunctionthat builds the defaultListenerInvocationErrorHandler. Defaults to aLoggingErrorHandler.- Parameters:
listenerInvocationErrorHandlerBuilder- aFunctionthat builds the defaultListenerInvocationErrorHandler- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerListenerInvocationErrorHandler
EventProcessingConfigurer registerListenerInvocationErrorHandler(String processingGroup, Function<Configuration, ListenerInvocationErrorHandler> listenerInvocationErrorHandlerBuilder) - Parameters:
processingGroup- aStringspecifying the name of a processing grouplistenerInvocationErrorHandlerBuilder- aFunctionthat buildsListenerInvocationErrorHandler- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerTrackingEventProcessor
Registers aTrackingEventProcessorwith givennamewithin this Configurer.- Parameters:
name- aStringspecifying the name of theTrackingEventProcessorbeing registered- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
configureDefaultStreamableMessageSource
EventProcessingConfigurer configureDefaultStreamableMessageSource(Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> defaultSource) Configures whichStreamableMessageSourceto 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()orusingTrackingEventProcessors(), 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.- Parameters:
defaultSource- a Function that defines the Message source to use- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
configureDefaultSubscribableMessageSource
EventProcessingConfigurer configureDefaultSubscribableMessageSource(Function<Configuration, SubscribableMessageSource<EventMessage<?>>> defaultSource) Configures whichSubscribableMessageSourceto 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()orusingTrackingEventProcessors(), 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.- Parameters:
defaultSource- a Function that defines the Message source to use- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerTrackingEventProcessor
EventProcessingConfigurer registerTrackingEventProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> source) - Parameters:
name- aStringspecifying the name of theTrackingEventProcessorbeing registeredsource- aFunctionthat builds aStreamableMessageSource- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerTrackingEventProcessor
EventProcessingConfigurer registerTrackingEventProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> source, Function<Configuration, TrackingEventProcessorConfiguration> processorConfiguration) Registers aTrackingEventProcessorwith givenname,sourceandprocessorConfigurationwithin this Configurer.- Parameters:
name- aStringspecifying the name of theTrackingEventProcessorbeing registeredsource- aFunctionthat buildsStreamableMessageSourceprocessorConfiguration- aFunctionthat builds aTrackingEventProcessorConfiguration- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerEventProcessorFactory
EventProcessingConfigurer registerEventProcessorFactory(EventProcessingConfigurer.EventProcessorBuilder eventProcessorBuilder) Registers a factory that builds the defaultEventProcessor. This is theEventProcessingConfigurer.EventProcessorBuilderto be used when there is no specific builder for given processor name.- Parameters:
eventProcessorBuilder- aFunctionthat builds anEventProcessor- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerEventProcessor
EventProcessingConfigurer registerEventProcessor(String name, EventProcessingConfigurer.EventProcessorBuilder eventProcessorBuilder) Registers anEventProcessingConfigurer.EventProcessorBuilderfor the given processorname.- Parameters:
name- aStringspecifying the name of theEventProcessorbeing registeredeventProcessorBuilder- aFunctionthat builds anEventProcessor- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerTokenStore
EventProcessingConfigurer registerTokenStore(String processorName, Function<Configuration, TokenStore> tokenStoreBuilder) - Parameters:
processorName- aStringspecifying the name of a event processortokenStoreBuilder- aFunctionthat builds aTokenStore- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerTokenStore
Register aFunctionthat builds aTokenStoreto use as the default in case no explicit token store was configured for a processor.- Parameters:
tokenStore- aFunctionthat builds aTokenStore- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
usingSubscribingEventProcessors
EventProcessingConfigurer usingSubscribingEventProcessors()Defaults Event Processors builders to useSubscribingEventProcessor.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.- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
usingTrackingEventProcessors
EventProcessingConfigurer usingTrackingEventProcessors()Defaults Event Processors builders to useTrackingEventProcessor.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.- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
usingPooledStreamingEventProcessors
EventProcessingConfigurer usingPooledStreamingEventProcessors()Defaults Event Processors builders to usePooledStreamingEventProcessor.The default behavior depends on the
EventBusavailable in theConfiguration. If theEventBusis aStreamableMessageSource, processors are Tracking by default. This method must be used to force the use of Pooled Streaming Processors, unless specifically overridden for individual processors.- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
usingPooledStreamingEventProcessors
default EventProcessingConfigurer usingPooledStreamingEventProcessors(EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration) Defaults Event Processors builders to construct aPooledStreamingEventProcessorusing theconfigurationto configure them.The default behavior depends on the
EventBusavailable in theConfiguration. If theEventBusis aStreamableMessageSource, processors are Tracking by default. This method must be used to force the use of Pooled Streaming Processors, unless specifically overridden for individual processors.- Parameters:
pooledStreamingProcessorConfiguration- configuration used when constructing everyPooledStreamingEventProcessor- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerSubscribingEventProcessor
Registers aSubscribingEventProcessorwith givennamewithin this Configurer.- Parameters:
name- aStringspecyfing the name of theSubscribingEventProcessorbeing registered- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerSubscribingEventProcessor
EventProcessingConfigurer registerSubscribingEventProcessor(String name, Function<Configuration, SubscribableMessageSource<? extends EventMessage<?>>> messageSource) - Parameters:
name- aStringspecyfing the name of theSubscribingEventProcessorbeing registeredmessageSource- aFunctionthat builds aSubscribableMessageSource- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerDefaultErrorHandler
EventProcessingConfigurer registerDefaultErrorHandler(Function<Configuration, ErrorHandler> errorHandlerBuilder) - Parameters:
errorHandlerBuilder- aFunctionthat builds anErrorHandler- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerErrorHandler
EventProcessingConfigurer registerErrorHandler(String eventProcessorName, Function<Configuration, ErrorHandler> errorHandlerBuilder) - Parameters:
eventProcessorName- aStringspecifying the name of anEventProcessorerrorHandlerBuilder- aFunctionthat builds anErrorHandler- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
byDefaultAssignTo
Registers theprocessingGroupname to assign Event Handler and Saga beans to when no other, more explicit, rule matches and noProcessingGroupannotation is found.- Parameters:
processingGroup- aStringspecifying the name of a processing group- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
byDefaultAssignHandlerInstancesTo
EventProcessingConfigurer byDefaultAssignHandlerInstancesTo(Function<Object, String> assignmentFunction) Registers aFunctionthat defines the Event Processing Group name to assign Event Handler beans to when no other, more explicit, rule matches and noProcessingGroupannotation is found.- Parameters:
assignmentFunction- aFunctionthat returns the Processing Group for each Event Handler bean- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
byDefaultAssignHandlerTypesTo
EventProcessingConfigurer byDefaultAssignHandlerTypesTo(Function<Class<?>, String> assignmentFunction) Registers aFunctionthat defines the Event Processing Group name to assign Event Handler and Saga beans to when no other, more explicit, rule matches and noProcessingGroupannotation is found.- Parameters:
assignmentFunction- aFunctionthat returns the Processing Group for each Event Handler or Saga bean- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
assignHandlerInstancesMatching
default EventProcessingConfigurer assignHandlerInstancesMatching(String processingGroup, Predicate<Object> criteria) Configures a rule to assign Event Handler beans that match the givencriteriato the Processing Group with givenname, with neutral priority (value 0).Note that, when beans match multiple criteria for different Processing Groups with equal priority, the outcome is undefined.
- Parameters:
processingGroup- aStringspecifying the name of a processing group to assign matching Event Handlers tocriteria- aPredicatedefining the criteria for an Event Handler to match- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
assignHandlerTypesMatching
default EventProcessingConfigurer assignHandlerTypesMatching(String processingGroup, Predicate<Class<?>> criteria) Configures a rule to assign Event Handler beans that match the givencriteriato the Processing Group with givenname, with neutral priority (value 0).Note that, when beans match multiple criteria for different Processing Groups with equal priority, the outcome is undefined.
- Parameters:
processingGroup- aStringspecifying the name of a processing group to assign matching Event Handlers or Sagas tocriteria- aPredicatedefining the criteria for an Event Handler or Saga to match- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
assignHandlerInstancesMatching
EventProcessingConfigurer assignHandlerInstancesMatching(String processingGroup, int priority, Predicate<Object> criteria) Configures a rule to assign Event Handler beans that match the givencriteriato the Processing Group with givenname, with givenpriority. Rules with higher value ofprioritytake 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.
- Parameters:
processingGroup- aStringspecifying the name of a processing group to assign matching Event Handlers topriority- The priority for this rulecriteria- aPredicatedefining the criteria for an Event Handler to match- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
assignHandlerTypesMatching
EventProcessingConfigurer assignHandlerTypesMatching(String processingGroup, int priority, Predicate<Class<?>> criteria) Configures a rule to assign Event Handler beans that match the givencriteriato the Processing Group with givenname, with givenpriority. Rules with higher value ofprioritytake 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.
- Parameters:
processingGroup- aStringspecifying the name of the Processing Group to assign matching Event Handlers or Sagas topriority- anintspecifying the priority of this rulecriteria- aPredicatedefining the criteria for an Event Handler or Saga to match- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
assignProcessingGroup
Defines a mapping for assigning processing groups to processors.- Parameters:
processingGroup- aStringspecifying the processing group to be assignedprocessorName- aStringspecifying the processor name to assign the group to- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
assignProcessingGroup
Defines a rule for assigning processing groups to processors if processing group to processor name mapping does not contain the entry.- Parameters:
assignmentRule- aFunctionwhich takes a processing group and returns a processor name- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing - See Also:
-
registerHandlerInterceptor
EventProcessingConfigurer registerHandlerInterceptor(String processorName, Function<Configuration, MessageHandlerInterceptor<? super EventMessage<?>>> interceptorBuilder) Register the giveninterceptorBuilderto build aMessageHandlerInterceptorfor theEventProcessorwith givenprocessorName.The
interceptorBuildermay returnnull, in which case the return value is ignored.- Parameters:
processorName- aStringspecyfing the name of the processor to register theMessageHandlerInterceptoroninterceptorBuilder- aFunctionproviding theMessageHandlerInterceptorto register, ornull- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerDefaultHandlerInterceptor
EventProcessingConfigurer registerDefaultHandlerInterceptor(BiFunction<Configuration, String, MessageHandlerInterceptor<? super EventMessage<?>>> interceptorBuilder) Register the giveninterceptorBuilderas a default to build aMessageHandlerInterceptorforEventProcessors created in this configuration.The
interceptorBuilderis invoked once for each processor created, and may returnnull, in which case the return value is ignored.- Parameters:
interceptorBuilder- a builderFunctionthat provides aMessageHandlerInterceptorfor each available processor- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerSequencingPolicy
EventProcessingConfigurer registerSequencingPolicy(String processingGroup, Function<Configuration, SequencingPolicy<? super EventMessage<?>>> policyBuilder) Registers theSequencingPolicycreated by the givenpolicyBuilderto the processing group with givenprocessingGroup. Any previously configured policy for the same name will be overwritten.- Parameters:
processingGroup- aStringspecifying the name of the processing group to assign theSequencingPolicyforpolicyBuilder- a builderFunctionto create theSequencingPolicyto use- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerDefaultSequencingPolicy
EventProcessingConfigurer registerDefaultSequencingPolicy(Function<Configuration, SequencingPolicy<? super EventMessage<?>>> policyBuilder) Registers theSequencingPolicycreated by givenpolicyBuilderto the processing groups for which no explicit policy is defined (usingregisterSequencingPolicy(String, Function)).Defaults to a
SequentialPerAggregatePolicy.- Parameters:
policyBuilder- a builderFunctionto create theSequencingPolicyto use- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerMessageMonitor
default EventProcessingConfigurer registerMessageMonitor(String eventProcessorName, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) - Parameters:
eventProcessorName- aStringspecifying the name of anEventProcessormessageMonitorBuilder- a builderFunctionto create aMessageMonitor- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerMessageMonitorFactory
EventProcessingConfigurer registerMessageMonitorFactory(String eventProcessorName, MessageMonitorFactory messageMonitorFactory) - Parameters:
eventProcessorName- aStringspecifying the name of anEventProcessormessageMonitorFactory- aMessageMonitorFactoryused to create aMessageMonitor- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerRollbackConfiguration
EventProcessingConfigurer registerRollbackConfiguration(String name, Function<Configuration, RollbackConfiguration> rollbackConfigurationBuilder) Registers aFunctionthat builds theRollbackConfigurationfor given processorname. Defaults to aRollbackConfigurationType.ANY_THROWABLE- Parameters:
name- aStringspecifying the name of anEventProcessorrollbackConfigurationBuilder- aFunctionthat builds aRollbackConfiguration- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerTransactionManager
EventProcessingConfigurer registerTransactionManager(String name, Function<Configuration, TransactionManager> transactionManagerBuilder) - Parameters:
name- aStringspecifying the name of anEventProcessortransactionManagerBuilder- aFunctionthat builds aTransactionManager- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerDefaultTransactionManager
EventProcessingConfigurer registerDefaultTransactionManager(Function<Configuration, TransactionManager> transactionManagerBuilder) Registers a defaultTransactionManagerfor allEventProcessors. The providedTransactionManageris used whenever no processor specificTransactionManageris configured.- Parameters:
transactionManagerBuilder- aFunctionthat builds aTransactionManager- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerTrackingEventProcessorConfiguration
EventProcessingConfigurer registerTrackingEventProcessorConfiguration(String name, Function<Configuration, TrackingEventProcessorConfiguration> trackingEventProcessorConfigurationBuilder) Register aFunctionthat builds aTrackingEventProcessorConfigurationto be used by theEventProcessorcorresponding to the givenname.- Parameters:
name- aStringspecifying the name of anEventProcessortrackingEventProcessorConfigurationBuilder- aFunctionthat builds aTrackingEventProcessorConfiguration- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerTrackingEventProcessorConfiguration
EventProcessingConfigurer registerTrackingEventProcessorConfiguration(Function<Configuration, TrackingEventProcessorConfiguration> trackingEventProcessorConfigurationBuilder) Register aFunctionthat builds aTrackingEventProcessorConfigurationto use as the default.- Parameters:
trackingEventProcessorConfigurationBuilder- aFunctionthat builds aTrackingEventProcessorConfiguration- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerPooledStreamingEventProcessor
Registers aPooledStreamingEventProcessorin thisEventProcessingConfigurer. The processor will receive the givenname.- Parameters:
name- the name of thePooledStreamingEventProcessorbeing registered- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerPooledStreamingEventProcessor
default EventProcessingConfigurer registerPooledStreamingEventProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> messageSource) Registers aPooledStreamingEventProcessorin thisEventProcessingConfigurer. The processor will receive the givennameand use the outcome of themessageSourceas theStreamableMessageSource.- Parameters:
name- the name of thePooledStreamingEventProcessorbeing registeredmessageSource- constructs aStreamableMessageSourceto be used by thePooledStreamingEventProcessor- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerPooledStreamingEventProcessor
EventProcessingConfigurer registerPooledStreamingEventProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> messageSource, EventProcessingConfigurer.PooledStreamingProcessorConfiguration processorConfiguration) Registers aPooledStreamingEventProcessorin thisEventProcessingConfigurer. The processor will receive the givennameand use the outcome of themessageSourceas theStreamableMessageSource.The
processorConfigurationwill be used to further configure thePooledStreamingEventProcessorupon construction. Note that theprocessorConfigurationwill override any configuration set through theregisterPooledStreamingEventProcessorConfiguration(PooledStreamingProcessorConfiguration)andregisterPooledStreamingEventProcessorConfiguration(String, PooledStreamingProcessorConfiguration).- Parameters:
name- the name of thePooledStreamingEventProcessorbeing registeredmessageSource- constructs aStreamableMessageSourceto be used by thePooledStreamingEventProcessorprocessorConfiguration- allows further customization of thePooledStreamingEventProcessorunder construction. The givenConfigurationcan be used to extract components and use them in thePooledStreamingEventProcessor.Builder- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerPooledStreamingEventProcessorConfiguration
EventProcessingConfigurer registerPooledStreamingEventProcessorConfiguration(EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration) Register a defaultEventProcessingConfigurer.PooledStreamingProcessorConfigurationto be used when constructing everyPooledStreamingEventProcessor.- Parameters:
pooledStreamingProcessorConfiguration- configuration used when constructing everyPooledStreamingEventProcessor- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerPooledStreamingEventProcessorConfiguration
EventProcessingConfigurer registerPooledStreamingEventProcessorConfiguration(String name, EventProcessingConfigurer.PooledStreamingProcessorConfiguration pooledStreamingProcessorConfiguration) Register aEventProcessingConfigurer.PooledStreamingProcessorConfigurationto be used when constructing aPooledStreamingEventProcessorwithname.- Parameters:
name- the name of anPooledStreamingEventProcessorpooledStreamingProcessorConfiguration- configuration used when constructing aPooledStreamingEventProcessorwith the givenname- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
registerDeadLetterQueue
default EventProcessingConfigurer registerDeadLetterQueue(@Nonnull String processingGroup, @Nonnull Function<Configuration, SequencedDeadLetterQueue<EventMessage<?>>> queueBuilder) Register aSequencedDeadLetterQueuefor the givenprocessingGroup. TheSequencedDeadLetterQueuewill automatically enqueue failed events and evaluate them per the queue's configuration.- Parameters:
processingGroup- AStringspecifying the name of the processing group to register the givenSequencedDeadLetterQueuefor.queueBuilder- A builder method returning aSequencedDeadLetterQueuebased on aConfiguration. The outcome is used by the givenprocessingGroupto enqueue and evaluate failed events in.- Returns:
- The current
EventProcessingConfigurerinstance, for fluent interfacing.
-
registerDefaultDeadLetterPolicy
default EventProcessingConfigurer registerDefaultDeadLetterPolicy(@Nonnull Function<Configuration, EnqueuePolicy<EventMessage<?>>> policyBuilder) Register a defaultdead letter policyfor any processing group using adead letter queue. The processing group uses the policy to deduce whether a failedEventMessageshould beenqueuedfor later evaluation.Note that the configured component will not be used if the processing group does not have a dead letter queue.
- Parameters:
policyBuilder- A builder method to construct a defaultdead letter policy.- Returns:
- The current
EventProcessingConfigurerinstance, for fluent interfacing.
-
registerDeadLetterPolicy
default EventProcessingConfigurer registerDeadLetterPolicy(@Nonnull String processingGroup, @Nonnull Function<Configuration, EnqueuePolicy<EventMessage<?>>> policyBuilder) Register adead letter policyfor the givenprocessingGroupusing adead letter queue. The processing group uses the policy to deduce whether a failedEventMessageshould beenqueuedfor later evaluation.Note that the configured component will not be used if the processing group does not have a dead letter queue.
- Parameters:
processingGroup- The name of the processing group to build anEnqueuePolicyfor.policyBuilder- A builder method to construct adead letter policyfor the givenprocessingGroup.- Returns:
- The current
EventProcessingConfigurerinstance, for fluent interfacing.
-
registerDeadLetteringEventHandlerInvokerConfiguration
default EventProcessingConfigurer registerDeadLetteringEventHandlerInvokerConfiguration(@Nonnull String processingGroup, @Nonnull EventProcessingConfigurer.DeadLetteringInvokerConfiguration configuration) Register aEventProcessingConfigurer.DeadLetteringInvokerConfigurationfor the givenprocessingGroup. This configuration object allows for fine-grained customization of adead lettering processing groupthrough itsbuilder.Note that the configured component will not be used if the processing group does not have a dead letter queue.
- Parameters:
processingGroup- The name of the processing group to attach additional configuration too.configuration- The additional configuration for the dead lettering processing group.- Returns:
- The current
EventProcessingConfigurerinstance, for fluent interfacing.
-
registerDeadLetterQueueProvider
default EventProcessingConfigurer registerDeadLetterQueueProvider(Function<String, Function<Configuration, SequencedDeadLetterQueue<EventMessage<?>>>> deadLetterQueueProvider) Register the givendeadLetterProvideras a default to build aSequencedDeadLetterQueueforEventProcessors created in this configuration.The
deadLetterProvidermight return null if the given processing group name should not have a sequenced dead letter queue. An explicitly sequenced dead letter queue set usingregisterDeadLetterQueue(String, Function)will always have precedence over the one provided by this method.- Parameters:
deadLetterQueueProvider- a builderFunctionthat provides aSequencedDeadLetterQueuefor a processing group. It's possible to return null depending on the processing group.- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-
usingSubscribingEventProcessors
default EventProcessingConfigurer usingSubscribingEventProcessors(EventProcessingConfigurer.SubscribableMessageSourceDefinitionBuilder builder) If this method is invoked, Subscribing Event Processors will be created for all processing groups if none was explicitly provided.- Parameters:
builder- a function that createsSubscribableMessageSourceDefinitionfor given processing group name.- Returns:
- the current
EventProcessingConfigurerinstance, for fluent interfacing
-