Class SubscribingEventProcessorModule
- All Implemented Interfaces:
Module,ModuleBuilder<SubscribingEventProcessorModule>,EventProcessorModule,EventProcessorModule.CustomizationPhase<SubscribingEventProcessorModule,,SubscribingEventProcessorConfiguration> EventProcessorModule.EventHandlingPhase<SubscribingEventProcessorModule,SubscribingEventProcessorConfiguration>
SubscribingEventProcessor component.
The main capabilities provided by this module include:
- Event handling component decoration with tracing, monitoring, and interception
- Integration with shared configuration customizations from parent modules
- Lifecycle management for the created processor
- Automatic subscription to the configured message source
This module is typically not instantiated directly but created through
EventProcessorModule.subscribing(String) or registered via
SubscribingEventProcessorsConfigurer.defaultProcessor(java.lang.String, java.util.function.Function<org.axonframework.messaging.eventhandling.configuration.EventHandlingComponentsConfigurer.RequiredComponentPhase, org.axonframework.messaging.eventhandling.configuration.EventHandlingComponentsConfigurer.CompletePhase>) methods.
The module applies shared defaults from SubscribingEventProcessorsConfigurer and
EventProcessingConfigurer before applying
processor-specific customizations.
- Since:
- 5.0.0
- Author:
- Mateusz Nowak
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAllows customizing theSubscribingEventProcessorConfiguration.Nested classes/interfaces inherited from interface org.axonframework.messaging.eventhandling.configuration.EventProcessorModule
EventProcessorModule.CustomizationPhase<P extends EventProcessorModule,C extends EventProcessorConfiguration>, EventProcessorModule.EventHandlingPhase<P extends EventProcessorModule, C extends EventProcessorConfiguration> -
Field Summary
Fields inherited from class org.axonframework.common.configuration.BaseModule
name -
Constructor Summary
ConstructorsConstructorDescriptionSubscribingEventProcessorModule(String processorName) Constructs a module with the given processor name. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aModuleof typeM.customized(BiFunction<Configuration, SubscribingEventProcessorConfiguration, SubscribingEventProcessorConfiguration> instanceCustomization) Customizes the processor configuration by applying modifications to the default configuration.EventProcessorModule.CustomizationPhase<SubscribingEventProcessorModule, SubscribingEventProcessorConfiguration> eventHandlingComponents(Function<EventHandlingComponentsConfigurer.RequiredComponentPhase, EventHandlingComponentsConfigurer.CompletePhase> configurerTask) Configures event handling components using a configurer function.Builds the processor module with the current configuration.Methods inherited from class org.axonframework.common.configuration.BaseModule
build, componentRegistry, name, postProcessConfiguration
-
Constructor Details
-
SubscribingEventProcessorModule
Constructs a module with the given processor name.The processor name will be used as the module name and as the unique identifier for the
SubscribingEventProcessorcomponent created by this module.- Parameters:
processorName- The unique name for the subscribing event processor.
-
-
Method Details
-
build
Description copied from interface:ModuleBuilderBuilds aModuleof typeM.- Specified by:
buildin interfaceModuleBuilder<SubscribingEventProcessorModule>- Returns:
- A
Moduleof typeM.
-
customized
public SubscribingEventProcessorModule customized(BiFunction<Configuration, SubscribingEventProcessorConfiguration, SubscribingEventProcessorConfiguration> instanceCustomization) Description copied from interface:EventProcessorModule.CustomizationPhaseCustomizes the processor configuration by applying modifications to the default configuration.This method applies processor-specific customizations on top of shared defaults from parent modules, providing the recommended approach for most configuration scenarios.
Customizations compound: calling this method again applies the given
instanceCustomizationon top of the configuration the previous one returned, in registration order. Two customizations that set the same property therefore resolve to the value of the last one registered, while everything else each of them set is retained. This lets an integration configure a processor from its own settings without discarding what the application configured, or the other way around.- Specified by:
customizedin interfaceEventProcessorModule.CustomizationPhase<SubscribingEventProcessorModule,SubscribingEventProcessorConfiguration> - Parameters:
instanceCustomization- A function that receives the configuration and default processor config, returning the customized processor configuration.- Returns:
- The configured processor module.
-
notCustomized
Description copied from interface:EventProcessorModule.CustomizationPhaseBuilds the processor module with the current configuration.- Specified by:
notCustomizedin interfaceEventProcessorModule.CustomizationPhase<SubscribingEventProcessorModule,SubscribingEventProcessorConfiguration> - Returns:
- The configured processor module.
-
eventHandlingComponents
public EventProcessorModule.CustomizationPhase<SubscribingEventProcessorModule,SubscribingEventProcessorConfiguration> eventHandlingComponents(Function<EventHandlingComponentsConfigurer.RequiredComponentPhase, EventHandlingComponentsConfigurer.CompletePhase> configurerTask) Description copied from interface:EventProcessorModule.EventHandlingPhaseConfigures event handling components using a configurer function.- Specified by:
eventHandlingComponentsin interfaceEventProcessorModule.EventHandlingPhase<SubscribingEventProcessorModule,SubscribingEventProcessorConfiguration> - Parameters:
configurerTask- The configurer function.- Returns:
- The customization phase for further configuration.
-