Interface ProcessorModuleFactory

All Known Implementing Classes:
DefaultProcessorModuleFactory

public interface ProcessorModuleFactory
Factory for building EventProcessorModules from a set of discovered event handler components.

This interface should only be implemented if the default assignment rules for event processors need to be customized beyond what ProcessorDefinition provides. The factory is responsible for determining which event handlers should be assigned to which processors and creating the corresponding modules.

The default implementation (DefaultProcessorModuleFactory) uses ProcessorDefinitions to assign handlers based on their selectors. If no matching processor definition is found for a handler, it defaults to assigning the handler to a processor named after the handler's package.

Custom implementations can provide completely different assignment logic, such as:

  • Assigning handlers based on annotations
  • Using naming conventions
  • Grouping by domain boundaries
  • Implementing custom load balancing strategies
Since:
5.0.2
Author:
Allard Buijze
See Also:
  • Method Details

    • buildProcessorModules

      @Nonnull Set<EventProcessorModule> buildProcessorModules(@Nonnull Set<ProcessorDefinition.EventHandlerDescriptor> handlers)
      Builds a set of EventProcessorModules from the given event handler descriptors.

      Each module represents an event processor with its assigned event handlers. The factory determines the assignment logic and creates appropriately configured modules.

      Parameters:
      handlers - The set of discovered event handler components to be assigned to processors.
      Returns:
      A set of event processor modules, each containing its assigned event handlers.