Class FluxMessageChannel

All Implemented Interfaces:
org.reactivestreams.Publisher<Message<?>>, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Lifecycle, ReactiveStreamsSubscribableChannel, ComponentSourceAware, ExpressionCapable, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageChannel, InterceptableChannel

public class FluxMessageChannel extends AbstractMessageChannel implements org.reactivestreams.Publisher<Message<?>>, ReactiveStreamsSubscribableChannel, Lifecycle
The AbstractMessageChannel implementation for the Reactive Streams Publisher based on the Project Reactor Flux.

This class implements Lifecycle to control subscriptions to publishers attached via subscribeTo(Publisher), when this channel is restarted.

Since:
5.0
Author:
Artem Bilan, Gary Russell, Sergei Egorov
  • Constructor Details

    • FluxMessageChannel

      public FluxMessageChannel()
  • Method Details

    • doSend

      protected boolean doSend(Message<?> message, long timeout)
      Description copied from class: AbstractMessageChannel
      Subclasses must implement this method. A non-negative timeout indicates how long to wait if the channel is at capacity (if the value is 0, it must return immediately with or without success). A negative timeout value indicates that the method should block until either the message is accepted or the blocking thread is interrupted.
      Specified by:
      doSend in class AbstractMessageChannel
      Parameters:
      message - The message.
      timeout - The timeout.
      Returns:
      true if the send was successful.
    • subscribe

      public void subscribe(org.reactivestreams.Subscriber<? super Message<?>> subscriber)
      Specified by:
      subscribe in interface org.reactivestreams.Publisher<Message<?>>
    • start

      public void start()
      Specified by:
      start in interface Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface Lifecycle
    • subscribeTo

      public void subscribeTo(org.reactivestreams.Publisher<? extends Message<?>> publisher)
      Specified by:
      subscribeTo in interface ReactiveStreamsSubscribableChannel
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean
      Specified by:
      destroy in interface IntegrationManagement
      Overrides:
      destroy in class AbstractMessageChannel