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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMessageToGroup(Object groupId, Message<?> message) Store a message with an association to a group id.intgetMessageGroup(Object groupId) Return all Messages currently in the MessageStore that were stored usingBasicMessageGroupStore.addMessageToGroup(Object, Message)with this group id.intbooleanintmessageGroupSize(Object groupId) Return the size of this MessageGroup.@Nullable Message<?> pollMessageFromGroup(Object groupId) Poll Message from thisMessageGroup(in FIFO style if supported by the implementation) while also removing the polledMessage.voidremoveMessageGroup(Object groupId) Remove the message group with this id.Methods inherited from class RedisChannelMessageStore
afterPropertiesSet, getBeanName, getMessageGroupFactory, getRedisTemplate, setBeanClassLoader, setBeanName, setMessageGroupFactory, setValueSerializer
-
Constructor Details
-
RedisChannelPriorityMessageStore
-
-
Method Details
-
isPriorityEnabled
public boolean isPriorityEnabled()- Specified by:
isPriorityEnabledin interfacePriorityCapableChannelMessageStore- Returns:
- true if message priority is enabled in this channel message store.
-
messageGroupSize
Description copied from interface:BasicMessageGroupStoreReturn the size of this MessageGroup.- Specified by:
messageGroupSizein interfaceBasicMessageGroupStore- Overrides:
messageGroupSizein classRedisChannelMessageStore- Parameters:
groupId- The group identifier.- Returns:
- The size.
-
getMessageGroup
Description copied from interface:BasicMessageGroupStoreReturn all Messages currently in the MessageStore that were stored usingBasicMessageGroupStore.addMessageToGroup(Object, Message)with this group id.- Specified by:
getMessageGroupin interfaceBasicMessageGroupStore- Overrides:
getMessageGroupin classRedisChannelMessageStore- Parameters:
groupId- The group identifier.- Returns:
- A group of messages, empty if none exists for this key.
-
addMessageToGroup
Description copied from interface:BasicMessageGroupStoreStore a message with an association to a group id. This can be used to group messages together.- Specified by:
addMessageToGroupin interfaceBasicMessageGroupStore- Overrides:
addMessageToGroupin classRedisChannelMessageStore- Parameters:
groupId- The group id to store the message under.message- A message.- Returns:
- The message group.
-
pollMessageFromGroup
Description copied from interface:BasicMessageGroupStorePoll Message from thisMessageGroup(in FIFO style if supported by the implementation) while also removing the polledMessage.- Specified by:
pollMessageFromGroupin interfaceBasicMessageGroupStore- Overrides:
pollMessageFromGroupin classRedisChannelMessageStore- Parameters:
groupId- The group identifier.- Returns:
- The message.
-
getMessageGroupCount
- Overrides:
getMessageGroupCountin classRedisChannelMessageStore
-
removeMessageGroup
Description copied from interface:BasicMessageGroupStoreRemove the message group with this id.- Specified by:
removeMessageGroupin interfaceBasicMessageGroupStore- Overrides:
removeMessageGroupin classRedisChannelMessageStore- Parameters:
groupId- The id of the group to remove.
-
getMessageCountForAllMessageGroups
- Overrides:
getMessageCountForAllMessageGroupsin classRedisChannelMessageStore
-