/** * Register the given {@code interceptorBuilder} to build an Message Handling Interceptor for the Event Processor * with given {@code processorName}. * <p> * The {@code interceptorBuilder} may return {@code null}, in which case the return value is ignored. * * @param processorName The name of the processor to register the interceptor on * @param interceptorBuilder The function providing the interceptor to register, or {@code null} * @return event processing configuration for chaining purposes */ public EventProcessingConfiguration registerHandlerInterceptor(String processorName, Function<Configuration, MessageHandlerInterceptor<? super EventMessage<?>>> interceptorBuilder) { if (configuration != null) { eventProcessor(processorName).ifPresent(eventProcessor -> eventProcessor .registerInterceptor(interceptorBuilder.apply(configuration))); } handlerInterceptorsBuilders.computeIfAbsent(processorName, k -> new ArrayList<>()) .add(interceptorBuilder); return this; }