Class ExecutorChannel

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

public class ExecutorChannel
extends AbstractExecutorChannel
An implementation of MessageChannel that delegates to an instance of UnicastingDispatcher which in turn delegates all dispatching invocations to an Executor.

NOTE: unlike DirectChannel, the ExecutorChannel does not support a shared transactional context between sender and handler, because the Executor typically does not block the sender's Thread since it uses another Thread for the dispatch. (SyncTaskExecutor is an exception but would provide no value for this channel. If synchronous dispatching is required, a DirectChannel should be used instead).

Since:
1.0.3
  • Constructor Details

    • ExecutorChannel

      public ExecutorChannel​(java.util.concurrent.Executor executor)
      Create an ExecutorChannel that delegates to the provided Executor when dispatching Messages.

      The Executor must not be null.

      Parameters:
      executor - The executor.
    • ExecutorChannel

      public ExecutorChannel​(java.util.concurrent.Executor executor, LoadBalancingStrategy loadBalancingStrategy)
      Create an ExecutorChannel with a LoadBalancingStrategy that delegates to the provided Executor when dispatching Messages.

      The Executor must not be null.

      Parameters:
      executor - The executor.
      loadBalancingStrategy - The load balancing strategy implementation.
  • Method Details