public class PriorityChannel extends QueueChannel
Comparator
.
The default comparator is based upon the message header's 'priority'.AbstractMessageChannel.ChannelInterceptorList
IntegrationManagement.ManagementOverrides
queueSemaphore
interceptors, meters
EXPRESSION_PARSER, logger
INDEFINITE_TIMEOUT
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
PriorityChannel()
Create a channel with an unbounded queue.
|
PriorityChannel(Comparator<Message<?>> comparator)
Create a channel with an unbounded queue.
|
PriorityChannel(int capacity)
Create a channel with the specified queue capacity.
|
PriorityChannel(int capacity,
Comparator<Message<?>> comparator)
Create a channel with the specified queue capacity.
|
PriorityChannel(MessageGroupQueue messageGroupQueue)
Create a channel based on the provided
MessageGroupQueue . |
PriorityChannel(PriorityCapableChannelMessageStore messageGroupStore,
Object groupId)
Create a channel based on the provided
PriorityCapableChannelMessageStore
and group id for message store operations. |
Modifier and Type | Method and Description |
---|---|
protected Message<?> |
doReceive(long timeout)
Subclasses must implement this method.
|
protected boolean |
doSend(Message<?> message,
long timeout)
Subclasses must implement this method.
|
int |
getRemainingCapacity()
Obtain the remaining capacity of this channel.
|
clear, destroy, getQueueSize, purge, registerMetricsCaptor
addInterceptor, addInterceptor, getIntegrationPatternType, hasExecutorInterceptors, receive, receive, removeInterceptor, removeInterceptor, setInterceptors
getComponentType, getFullChannelName, getIChannelInterceptorList, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, onInit, send, send, setDatatypes, setLoggingEnabled, setMessageConverter, setShouldTrack
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
send, send
getInterceptors
getManagedName, getManagedType, getThisAs, setManagedName, setManagedType
getBeanName, getComponentName
public PriorityChannel()
StaticMessageHeaderAccessor.getPriority(Message)
.public PriorityChannel(int capacity)
StaticMessageHeaderAccessor.getPriority(Message)
.capacity
- The queue capacity.public PriorityChannel(Comparator<Message<?>> comparator)
Comparator
. If the comparator
is null
, the priority will be based upon the value of
StaticMessageHeaderAccessor.getPriority(Message)
.comparator
- The comparator.public PriorityChannel(int capacity, @Nullable Comparator<Message<?>> comparator)
Comparator
. If the comparator
is null
, the priority will be based upon the value of
StaticMessageHeaderAccessor.getPriority(Message)
.capacity
- The capacity.comparator
- The comparator.public PriorityChannel(PriorityCapableChannelMessageStore messageGroupStore, Object groupId)
PriorityCapableChannelMessageStore
and group id for message store operations.messageGroupStore
- the PriorityCapableChannelMessageStore
to use.groupId
- to group message for this channel in the message store.public PriorityChannel(MessageGroupQueue messageGroupQueue)
MessageGroupQueue
.messageGroupQueue
- the MessageGroupQueue
to use.public int getRemainingCapacity()
QueueChannelOperations
getRemainingCapacity
in interface QueueChannelOperations
getRemainingCapacity
in class QueueChannel
protected boolean doSend(Message<?> message, long timeout)
AbstractMessageChannel
doSend
in class QueueChannel
message
- The message.timeout
- The timeout.protected Message<?> doReceive(long timeout)
AbstractPollableChannel
doReceive
in class QueueChannel
timeout
- The timeout.