Class QueueChannel

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ExecutorChannelInterceptorAware, QueueChannelOperations, ExpressionCapable, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageChannel, PollableChannel, InterceptableChannel
Direct Known Subclasses:
PriorityChannel, RendezvousChannel

public class QueueChannel extends AbstractPollableChannel implements QueueChannelOperations
Simple implementation of a message channel. Each Message is placed in a BlockingQueue whose capacity may be specified upon construction. The capacity must be a positive integer value. For a zero-capacity version based upon a SynchronousQueue, consider the RendezvousChannel.
Author:
Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan
  • Field Details

    • queueSemaphore

      protected final Semaphore queueSemaphore
  • Constructor Details

    • QueueChannel

      public QueueChannel(Queue<Message<?>> queue)
      Create a channel with the specified queue.
      Parameters:
      queue - The queue.
    • QueueChannel

      public QueueChannel(int capacity)
      Create a channel with the specified queue capacity.
      Parameters:
      capacity - The capacity.
    • QueueChannel

      public QueueChannel()
      Create a channel with "unbounded" queue capacity. The actual capacity value is Integer.MAX_VALUE. Note that a bounded queue is recommended, since an unbounded queue may lead to OutOfMemoryErrors.
  • Method Details