/** * Allows for more fine-grained definition of the Event Processor to use for each group of Event Listeners. The * given builder is expected to create a fully initialized Event Processor implementation based on the name and * list of event handler beans. The builder also received the global configuration instance, from which it can * retrieve components. * <p> * Note that the processor must be initialized, but shouldn't be started yet. The processor's * {@link EventProcessor#start()} method is invoked when the global configuration is started. * * @param eventProcessorBuilder The builder function for the Event Processor * @return this EventHandlingConfiguration instance for further configuration * @deprecated use {@link EventProcessingConfiguration#registerEventProcessorFactory(EventProcessingConfiguration.EventProcessorBuilder)} * instead */ @Deprecated public EventHandlingConfiguration registerEventProcessorFactory(EventProcessorBuilder eventProcessorBuilder) { onInit.add(conf -> conf.eventProcessingConfiguration() .registerEventProcessorFactory( (name, config, eventHandlerInvoker) -> buildEventProcessor(name, config, (MultiEventHandlerInvoker) eventHandlerInvoker, eventProcessorBuilder))); return this; }
/** * Configure the use of Tracking Event Processors, instead of the default Subscribing ones. Tracking processors * work in their own thread(s), making processing asynchronous from the publication process. * <p> * The processor will use the {@link TokenStore} implementation provided in the global Configuration, and will * default to an {@link InMemoryTokenStore} when no Token Store was defined. Note that it is not recommended to use * the in-memory TokenStore in a production environment. * * @param processorConfig The configuration for the processors to use * @return event processing configuration for chaining purposes */ public EventProcessingConfiguration usingTrackingProcessors( Function<Configuration, TrackingEventProcessorConfiguration> processorConfig) { registerEventProcessorFactory( (name, config, ehi) -> { TrackingEventProcessor trackingEventProcessor = trackingEventProcessor(config, name, ehi, processorConfig, Configuration::eventBus); trackingEventProcessor .registerInterceptor(new CorrelationDataInterceptor<>(config.correlationDataProviders())); return trackingEventProcessor; }); return this; }