Class EventProcessingConfigurer

java.lang.Object
org.axonframework.messaging.eventhandling.configuration.EventProcessingConfigurer

public class EventProcessingConfigurer extends Object
A configuration module for event processing that provides a unified way to configure and manage both EventProcessor types:

The EventProcessingConfigurer acts as a composite module that delegates event EventProcessorConfiguration to specialized sub-modules: PooledStreamingEventProcessorsConfigurer for PooledStreamingEventProcessor instances and SubscribingEventProcessorsConfigurer for SubscribingEventProcessor instances.

The main purpose is to provide shared configuration capabilities for all event processor types, allowing you to set default configurations like UnitOfWorkFactory that apply to all processors while still enabling type-specific customizations.

The module automatically configures default transaction management by registering a TransactionalUnitOfWorkFactory when a TransactionManager is available in the configuration.

This module is automatically created and registered by the MessagingConfigurer when the application starts, so you typically don't need to instantiate it manually. Instead, access it through MessagingConfigurer.eventProcessing(java.util.function.Consumer).

Example usage:


 MessagingConfigurer.create()
     .eventProcessing(eventProcessing -> eventProcessing
         .defaults(config -> config.unitOfWorkFactory(new SimpleUnitOfWorkFactory()))
         .pooledStreaming(pooledStreaming ->
             pooledStreaming.processor("calendar-processor", components -> components.declarative(cfg -> weekStartedEventHandler))
                        .processor("astrologers-week-symbol-processor", components -> components.declarative(cfg -> weekSymbolProclaimedEventHandler)))
         .subscribing(subscribing ->
             subscribing.processor("creatures-dwelling-readmodel", components -> components.autodetected(cfg -> dwellingBuiltEventHandler)));
 
Since:
5.0.0
Author:
Mateusz Nowak