public class RedisChannelPriorityMessageStore extends RedisChannelMessageStore implements PriorityCapableChannelMessageStore
PriorityCapableChannelMessageStore that uses lists to back a QueueChannel.
Messages are removed in priority order (IntegrationMessageHeaderAccessor.PRIORITY).
Priorities 0-9 are supported (9 the highest); invalid priority values are treated with the same priority (none)
as messages with no priority header (retrieved after any messages that have a priority).
Requires that groupId is a String.
| Constructor and Description |
|---|
RedisChannelPriorityMessageStore(RedisConnectionFactory connectionFactory) |
| Modifier and Type | Method and Description |
|---|---|
MessageGroup |
addMessageToGroup(Object groupId,
Message<?> message)
Store a message with an association to a group id.
|
int |
getMessageCountForAllMessageGroups() |
MessageGroup |
getMessageGroup(Object groupId)
Return all Messages currently in the MessageStore that were stored using
BasicMessageGroupStore.addMessageToGroup(Object, Message) with this group id. |
int |
getMessageGroupCount() |
boolean |
isPriorityEnabled() |
int |
messageGroupSize(Object groupId)
Returns the size of this MessageGroup.
|
Message<?> |
pollMessageFromGroup(Object groupId)
Polls Message from this
MessageGroup (in FIFO style if supported by the implementation)
while also removing the polled Message |
void |
removeMessageGroup(Object groupId)
Remove the message group with this id.
|
afterPropertiesSet, getBeanName, getMessageGroupFactory, getRedisTemplate, setBeanName, setMessageGroupFactory, setValueSerializerpublic RedisChannelPriorityMessageStore(RedisConnectionFactory connectionFactory)
public boolean isPriorityEnabled()
isPriorityEnabled in interface PriorityCapableChannelMessageStore@ManagedAttribute public int messageGroupSize(Object groupId)
BasicMessageGroupStoremessageGroupSize in interface BasicMessageGroupStoremessageGroupSize in class RedisChannelMessageStoregroupId - The group identifier.public MessageGroup getMessageGroup(Object groupId)
BasicMessageGroupStoreBasicMessageGroupStore.addMessageToGroup(Object, Message) with this group id.getMessageGroup in interface BasicMessageGroupStoregetMessageGroup in class RedisChannelMessageStoregroupId - The group identifier.public MessageGroup addMessageToGroup(Object groupId, Message<?> message)
BasicMessageGroupStoreaddMessageToGroup in interface BasicMessageGroupStoreaddMessageToGroup in class RedisChannelMessageStoregroupId - The group id to store the message under.message - A message.public Message<?> pollMessageFromGroup(Object groupId)
BasicMessageGroupStoreMessageGroup (in FIFO style if supported by the implementation)
while also removing the polled MessagepollMessageFromGroup in interface BasicMessageGroupStorepollMessageFromGroup in class RedisChannelMessageStoregroupId - The group identifier.@ManagedAttribute public int getMessageGroupCount()
getMessageGroupCount in class RedisChannelMessageStorepublic void removeMessageGroup(Object groupId)
BasicMessageGroupStoreremoveMessageGroup in interface BasicMessageGroupStoreremoveMessageGroup in class RedisChannelMessageStoregroupId - The id of the group to remove.@ManagedAttribute public int getMessageCountForAllMessageGroups()
getMessageCountForAllMessageGroups in class RedisChannelMessageStore