Class ReactiveStreamsConsumer

All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, ExpressionCapable, IntegrationConsumer, NamedComponent, ManageableLifecycle, ManageableSmartLifecycle

public class ReactiveStreamsConsumer extends AbstractEndpoint implements IntegrationConsumer
An AbstractEndpoint implementation for Reactive Streams subscription into an input channel and reactive consumption of messages from that channel.
Since:
5.0
  • Constructor Details

    • ReactiveStreamsConsumer

      public ReactiveStreamsConsumer(org.springframework.messaging.MessageChannel inputChannel, org.springframework.messaging.MessageHandler messageHandler)
    • ReactiveStreamsConsumer

      public ReactiveStreamsConsumer(org.springframework.messaging.MessageChannel inputChannel, org.reactivestreams.Subscriber<org.springframework.messaging.Message<?>> subscriber)
    • ReactiveStreamsConsumer

      public ReactiveStreamsConsumer(org.springframework.messaging.MessageChannel inputChannel, org.springframework.messaging.ReactiveMessageHandler reactiveMessageHandler)
      Instantiate an endpoint based on the provided MessageChannel and ReactiveMessageHandler.
      Parameters:
      inputChannel - the channel to consume in reactive manner.
      reactiveMessageHandler - the ReactiveMessageHandler to process messages.
      Since:
      5.3
  • Method Details

    • setErrorHandler

      public void setErrorHandler(org.springframework.util.ErrorHandler errorHandler)
    • setReactiveCustomizer

      public void setReactiveCustomizer(@Nullable Function<? super reactor.core.publisher.Flux<org.springframework.messaging.Message<?>>,? extends org.reactivestreams.Publisher<org.springframework.messaging.Message<?>>> reactiveCustomizer)
    • getInputChannel

      public org.springframework.messaging.MessageChannel getInputChannel()
      Description copied from interface: IntegrationConsumer
      Return the input channel.
      Specified by:
      getInputChannel in interface IntegrationConsumer
      Returns:
      the input channel.
    • getOutputChannel

      public org.springframework.messaging.MessageChannel getOutputChannel()
      Description copied from interface: IntegrationConsumer
      Return the output channel (may be null).
      Specified by:
      getOutputChannel in interface IntegrationConsumer
      Returns:
      the output channel.
    • getHandler

      public org.springframework.messaging.MessageHandler getHandler()
      Description copied from interface: IntegrationConsumer
      Return the consumer's handler.
      Specified by:
      getHandler in interface IntegrationConsumer
      Returns:
      the handler.
    • onInit

      protected void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      Overrides:
      onInit in class AbstractEndpoint
    • doStart

      protected void doStart()
      Description copied from class: AbstractEndpoint
      Subclasses must implement this method with the start behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.
      Specified by:
      doStart in class AbstractEndpoint
    • doStop

      protected void doStop()
      Description copied from class: AbstractEndpoint
      Subclasses must implement this method with the stop behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.
      Specified by:
      doStop in class AbstractEndpoint