Class FluxAggregatorMessageHandler

All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Lifecycle, Ordered, ExpressionCapable, Orderable, MessageProducer, HeaderPropagationAware, IntegrationPattern, NamedComponent, IntegrationManagement, ManageableLifecycle, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>

public class FluxAggregatorMessageHandler
extends AbstractMessageProducingHandler
implements ManageableLifecycle
The AbstractMessageProducingHandler implementation for aggregation logic based on Reactor's Flux.groupBy(java.util.function.Function<? super T, ? extends K>) and Flux.window(int) operators.

The incoming messages are emitted into a FluxSink provided by the Flux.create(java.util.function.Consumer<? super reactor.core.publisher.FluxSink<T>>) initialized in the constructor.

The resulting windows for groups are wrapped into Messages for downstream consumption.

If the AbstractMessageProducingHandler.getOutputChannel() is not a ReactiveStreamsSubscribableChannel instance, a subscription for the whole aggregating Flux is performed in the start() method.

Since:
5.2
Author:
Artem Bilan