/** * 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 config The configuration for the processors to use * @param sequencingPolicy The policy for processing events sequentially * @return this EventHandlingConfiguration instance for further configuration * @deprecated use {@link EventProcessingConfiguration#usingTrackingProcessors(Function)} instead */ @Deprecated public EventHandlingConfiguration usingTrackingProcessors( Function<Configuration, TrackingEventProcessorConfiguration> config, Function<Configuration, SequencingPolicy<? super EventMessage<?>>> sequencingPolicy) { return registerEventProcessorFactory( (conf, name, handlers) -> buildTrackingEventProcessor(conf, name, handlers, config, Configuration::eventBus, sequencingPolicy)); }
/** * Registers a TrackingProcessor with the given {@code name}, reading from the given {@code source} and using the * given {@code processorConfiguration}. The given {@code sequencingPolicy} defines the policy for events that need * to be executed sequentially. * * @param name The name of the Tracking Processor * @param source The source to read Events from * @param processorConfiguration The configuration for the processor * @param sequencingPolicy The sequencing policy to apply when processing events in parallel * @return this EventHandlingConfiguration instance for further configuration * @deprecated use {@link EventProcessingConfiguration#registerTrackingEventProcessor(String, Function, Function)} instead */ @Deprecated public EventHandlingConfiguration registerTrackingProcessor(String name, Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>> source, Function<Configuration, TrackingEventProcessorConfiguration> processorConfiguration, Function<Configuration, SequencingPolicy<? super EventMessage<?>>> sequencingPolicy) { eventProcessorBuilders.put(name, (conf, handlers) -> conf.eventProcessingConfiguration() .registerEventProcessor(name, (n, c, ehi) -> buildTrackingEventProcessor(c, n, handlers, processorConfiguration, source, sequencingPolicy))); return this; }