Class RedisChannelPriorityMessageStore
java.lang.Object
org.springframework.integration.redis.store.RedisChannelMessageStore
org.springframework.integration.redis.store.RedisChannelPriorityMessageStore
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanNameAware
,InitializingBean
,BasicMessageGroupStore
,ChannelMessageStore
,PriorityCapableChannelMessageStore
public class RedisChannelPriorityMessageStore
extends RedisChannelMessageStore
implements PriorityCapableChannelMessageStore
Specialized Redis
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.
- Since:
- 4.0
- Author:
- Gary Russell, Artem Bilan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddMessageToGroup
(Object groupId, Message<?> message) Store a message with an association to a group id.int
getMessageGroup
(Object groupId) Return all Messages currently in the MessageStore that were stored usingBasicMessageGroupStore.addMessageToGroup(Object, Message)
with this group id.int
boolean
int
messageGroupSize
(Object groupId) Return the size of this MessageGroup.Message<?>
pollMessageFromGroup
(Object groupId) Poll Message from thisMessageGroup
(in FIFO style if supported by the implementation) while also removing the polledMessage
.void
removeMessageGroup
(Object groupId) Remove the message group with this id.Methods inherited from class org.springframework.integration.redis.store.RedisChannelMessageStore
afterPropertiesSet, getBeanName, getMessageGroupFactory, getRedisTemplate, setBeanClassLoader, setBeanName, setMessageGroupFactory, setValueSerializer
-
Constructor Details
-
RedisChannelPriorityMessageStore
-
-
Method Details
-
isPriorityEnabled
public boolean isPriorityEnabled()- Specified by:
isPriorityEnabled
in interfacePriorityCapableChannelMessageStore
- Returns:
- true if message priority is enabled in this channel message store.
-
messageGroupSize
Description copied from interface:BasicMessageGroupStore
Return the size of this MessageGroup.- Specified by:
messageGroupSize
in interfaceBasicMessageGroupStore
- Overrides:
messageGroupSize
in classRedisChannelMessageStore
- Parameters:
groupId
- The group identifier.- Returns:
- The size.
-
getMessageGroup
Description copied from interface:BasicMessageGroupStore
Return all Messages currently in the MessageStore that were stored usingBasicMessageGroupStore.addMessageToGroup(Object, Message)
with this group id.- Specified by:
getMessageGroup
in interfaceBasicMessageGroupStore
- Overrides:
getMessageGroup
in classRedisChannelMessageStore
- Parameters:
groupId
- The group identifier.- Returns:
- A group of messages, empty if none exists for this key.
-
addMessageToGroup
Description copied from interface:BasicMessageGroupStore
Store a message with an association to a group id. This can be used to group messages together.- Specified by:
addMessageToGroup
in interfaceBasicMessageGroupStore
- Overrides:
addMessageToGroup
in classRedisChannelMessageStore
- Parameters:
groupId
- The group id to store the message under.message
- A message.- Returns:
- The message group.
-
pollMessageFromGroup
Description copied from interface:BasicMessageGroupStore
Poll Message from thisMessageGroup
(in FIFO style if supported by the implementation) while also removing the polledMessage
.- Specified by:
pollMessageFromGroup
in interfaceBasicMessageGroupStore
- Overrides:
pollMessageFromGroup
in classRedisChannelMessageStore
- Parameters:
groupId
- The group identifier.- Returns:
- The message.
-
getMessageGroupCount
- Overrides:
getMessageGroupCount
in classRedisChannelMessageStore
-
removeMessageGroup
Description copied from interface:BasicMessageGroupStore
Remove the message group with this id.- Specified by:
removeMessageGroup
in interfaceBasicMessageGroupStore
- Overrides:
removeMessageGroup
in classRedisChannelMessageStore
- Parameters:
groupId
- The id of the group to remove.
-
getMessageCountForAllMessageGroups
- Overrides:
getMessageCountForAllMessageGroups
in classRedisChannelMessageStore
-