Class ChannelRegistration

java.lang.Object
org.springframework.messaging.simp.config.ChannelRegistration

public class ChannelRegistration extends Object
A registration class for customizing the configuration for a MessageChannel.
Since:
4.0
Author:
Rossen Stoyanchev, Stephane Nicoll
  • Constructor Details

    • ChannelRegistration

      public ChannelRegistration()
  • Method Details

    • taskExecutor

      public TaskExecutorRegistration taskExecutor()
      Configure the thread pool backing this message channel.
    • taskExecutor

      public TaskExecutorRegistration taskExecutor(@Nullable ThreadPoolTaskExecutor taskExecutor)
      Configure the thread pool backing this message channel using a custom ThreadPoolTaskExecutor.
      Parameters:
      taskExecutor - the executor to use (or null for a default executor)
    • executor

      public ChannelRegistration executor(TaskExecutor taskExecutor)
      Configure the given TaskExecutor for this message channel, taking precedence over a task executor registration if any.
      Parameters:
      taskExecutor - the task executor to use
      Since:
      6.1.4
    • interceptors

      public ChannelRegistration interceptors(ChannelInterceptor... interceptors)
      Configure the given interceptors for this message channel, adding them to the channel's current list of interceptors.
      Since:
      4.3.12
    • hasTaskExecutor

      protected boolean hasTaskExecutor()
    • hasInterceptors

      protected boolean hasInterceptors()
    • getTaskExecutor

      protected TaskExecutor getTaskExecutor(Supplier<TaskExecutor> fallback, Consumer<TaskExecutor> customizer)
      Return the TaskExecutor to use. If no task executor has been configured, the fallback supplier is used to provide a fallback instance.

      If the TaskExecutor to use is suitable for further customizations, the customizer consumer is invoked.

      Parameters:
      fallback - a supplier of a fallback task executor in case none is configured
      customizer - further customizations
      Returns:
      the task executor to use
      Since:
      6.1.4
    • getInterceptors

      protected List<ChannelInterceptor> getInterceptors()