public class PriorityChannel extends QueueChannel
Comparator
.
The default comparator is based upon the message header's 'priority'.AbstractMessageChannel.ChannelInterceptorList
IntegrationManagement.ManagementOverrides
queueSemaphore
interceptors
EXPRESSION_PARSER, logger
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
PriorityChannel()
Create a channel with an unbounded queue.
|
PriorityChannel(java.util.Comparator<org.springframework.messaging.Message<?>> comparator)
Create a channel with an unbounded queue.
|
PriorityChannel(int capacity)
Create a channel with the specified queue capacity.
|
PriorityChannel(int capacity,
java.util.Comparator<org.springframework.messaging.Message<?>> comparator)
Create a channel with the specified queue capacity.
|
PriorityChannel(MessageGroupQueue messageGroupQueue)
Create a channel based on the provided
MessageGroupQueue . |
PriorityChannel(PriorityCapableChannelMessageStore messageGroupStore,
java.lang.Object groupId)
Create a channel based on the provided
PriorityCapableChannelMessageStore
and group id for message store operations. |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.messaging.Message<?> |
doReceive(long timeout)
Subclasses must implement this method.
|
protected boolean |
doSend(org.springframework.messaging.Message<?> message,
long timeout)
Subclasses must implement this method.
|
int |
getRemainingCapacity() |
clear, getQueueSize, purge
addInterceptor, addInterceptor, getReceiveCount, getReceiveCountLong, getReceiveErrorCount, getReceiveErrorCountLong, hasExecutorInterceptors, receive, receive, removeInterceptor, removeInterceptor, setInterceptors
configureMetrics, getChannelInterceptors, getComponentType, getErrorRate, getFullChannelName, getInterceptors, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMetrics, getMetricsCaptor, getMinSendDuration, getOverrides, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSend, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onInit, registerMetricsCaptor, reset, send, send, setCountsEnabled, setDatatypes, setLoggingEnabled, setMessageConverter, setShouldTrack, setStatsEnabled
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, 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
getReceiveCount, getReceiveCountLong, getReceiveErrorCount, getReceiveErrorCountLong
getErrorRate, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMinSendDuration, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSend
isStatsEnabled, setStatsEnabled
getOverrides, isCountsEnabled, isLoggingEnabled, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled
getChannelInterceptors
getComponentName
public PriorityChannel()
IntegrationMessageHeaderAccessor.getPriority()
.public PriorityChannel(int capacity)
IntegrationMessageHeaderAccessor.getPriority()
.capacity
- The queue capacity.public PriorityChannel(java.util.Comparator<org.springframework.messaging.Message<?>> comparator)
Comparator
. If the comparator
is null
, the priority will be based upon the value of
IntegrationMessageHeaderAccessor.getPriority()
.comparator
- The comparator.public PriorityChannel(int capacity, java.util.Comparator<org.springframework.messaging.Message<?>> comparator)
Comparator
. If the comparator
is null
, the priority will be based upon the value of
IntegrationMessageHeaderAccessor.getPriority()
.capacity
- The capacity.comparator
- The comparator.public PriorityChannel(PriorityCapableChannelMessageStore messageGroupStore, java.lang.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()
getRemainingCapacity
in interface QueueChannelOperations
getRemainingCapacity
in interface QueueChannelManagement
getRemainingCapacity
in class QueueChannel
protected boolean doSend(org.springframework.messaging.Message<?> message, long timeout)
AbstractMessageChannel
doSend
in class QueueChannel
message
- The message.timeout
- The timeout.protected org.springframework.messaging.Message<?> doReceive(long timeout)
AbstractPollableChannel
doReceive
in class QueueChannel
timeout
- The timeout.