Class PublishSubscribeChannel

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, BroadcastCapableChannel, ExecutorChannelInterceptorAware, ExpressionCapable, IntegrationPattern, NamedComponent, IntegrationManagement, SubscribableChannelManagement, TrackableComponent, org.springframework.messaging.MessageChannel, org.springframework.messaging.SubscribableChannel, org.springframework.messaging.support.InterceptableChannel

public class PublishSubscribeChannel
extends AbstractExecutorChannel
implements BroadcastCapableChannel
A channel that sends Messages to each of its subscribers.
  • Constructor Details

    • PublishSubscribeChannel

      public PublishSubscribeChannel()
      Create a PublishSubscribeChannel that will invoke the handlers in the message sender's thread.
    • PublishSubscribeChannel

      public PublishSubscribeChannel​(boolean requireSubscribers)
      Create a PublishSubscribeChannel that will invoke the handlers in the message sender's thread considering the provided requireSubscribers flag.
      Parameters:
      requireSubscribers - if set to true, the sent message is considered as non-dispatched and rejected to the caller with the "Dispatcher has no subscribers".
      Since:
      5.4.3
    • PublishSubscribeChannel

      public PublishSubscribeChannel​(@Nullable java.util.concurrent.Executor executor)
      Create a PublishSubscribeChannel that will use an Executor to invoke the handlers. If this is null, each invocation will occur in the message sender's thread.
      Parameters:
      executor - The executor.
    • PublishSubscribeChannel

      public PublishSubscribeChannel​(@Nullable java.util.concurrent.Executor executor, boolean requireSubscribers)
      Create a PublishSubscribeChannel that will use an Executor to invoke the handlers. If this is null, each invocation will occur in the message sender's thread.
      Parameters:
      executor - The executor.
      requireSubscribers - if set to true, the sent message is considered as non-dispatched and rejected to the caller with the "Dispatcher has no subscribers".
      Since:
      5.4.3
  • Method Details