/** * Register a subscribing event processor with given {@code name} that subscribes to the Event Bus. * * @param name The name of the Event Processor * @return event processing configuration for chaining purposes */ public EventProcessingConfiguration registerSubscribingEventProcessor(String name) { return registerSubscribingEventProcessor(name, Configuration::eventBus); }
@Autowired public void config(EventProcessingConfiguration epConfig, @Qualifier("trade-events") SubscribableMessageSource<EventMessage<?>> tradeEvents) { epConfig.registerSubscribingEventProcessor("trading", c -> tradeEvents); }
/** * Register a subscribing processor with given {@code name} that subscribes to the given {@code messageSource}. * This allows the use of standard Subscribing Processors that listen to another source than the Event Bus. * * @param name The name of the Event Processor * @param messageSource The source the processor should read from * @return this EventHandlingConfiguration instance for further configuration * @deprecated use {@link EventProcessingConfiguration#registerSubscribingEventProcessor(String, Function)} instead */ @SuppressWarnings("UnusedReturnValue") @Deprecated public EventHandlingConfiguration registerSubscribingEventProcessor( String name, Function<Configuration, SubscribableMessageSource<? extends EventMessage<?>>> messageSource) { onInit.add(conf -> conf.eventProcessingConfiguration() .registerSubscribingEventProcessor(name, messageSource)); return this; }