public class QueueChannel extends AbstractPollableChannel implements QueueChannelOperations
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.AbstractMessageChannel.ChannelInterceptorListlogger| Constructor and Description |
|---|
QueueChannel()
Create a channel with "unbounded" queue capacity.
|
QueueChannel(java.util.concurrent.BlockingQueue<Message<?>> queue)
Create a channel with the specified queue.
|
QueueChannel(int capacity)
Create a channel with the specified queue capacity.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Message<?>> |
clear()
Remove all
Messages from this channel. |
protected Message<?> |
doReceive(long timeout)
Subclasses must implement this method.
|
protected boolean |
doSend(Message<?> message,
long timeout)
Subclasses must implement this method.
|
int |
getQueueSize()
Return the current number of queued
Messages in this channel. |
int |
getRemainingCapacity()
Return the remaining capacity of this channel.
|
java.util.List<Message<?>> |
purge(MessageSelector selector)
Remove any
Messages that are not accepted by the provided selector. |
receive, receiveaddInterceptor, getComponentType, getFullChannelName, getInterceptors, send, send, setConversionService, setDatatypes, setInterceptors, setShouldTrackafterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsend, sendgetComponentNamepublic QueueChannel(java.util.concurrent.BlockingQueue<Message<?>> queue)
public QueueChannel(int capacity)
public QueueChannel()
Integer.MAX_VALUE. Note that a bounded queue is recommended, since an
unbounded queue may lead to OutOfMemoryErrors.protected boolean doSend(Message<?> message, long timeout)
AbstractMessageChanneldoSend in class AbstractMessageChannelprotected Message<?> doReceive(long timeout)
AbstractPollableChanneldoReceive in class AbstractPollableChannelpublic java.util.List<Message<?>> clear()
Messages from this channel.clear in interface QueueChannelOperationspublic java.util.List<Message<?>> purge(MessageSelector selector)
Messages that are not accepted by the provided selector.purge in interface QueueChannelOperationspublic int getQueueSize()
QueueChannelOperationsMessages in this channel.getQueueSize in interface QueueChannelOperationspublic int getRemainingCapacity()
QueueChannelOperationsgetRemainingCapacity in interface QueueChannelOperations