Class RedisChannelMessageStore
java.lang.Object
org.springframework.integration.redis.store.RedisChannelMessageStore
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- BeanNameAware,- InitializingBean,- BasicMessageGroupStore,- ChannelMessageStore
- Direct Known Subclasses:
- RedisChannelPriorityMessageStore
public class RedisChannelMessageStore
extends Object
implements ChannelMessageStore, BeanNameAware, InitializingBean, BeanClassLoaderAware
Specialized Redis 
ChannelMessageStore that uses a list to back a QueueChannel.
 
 Requires setBeanName(String) which is used as part of the key.
- Since:
- 4.0
- Author:
- Gary Russell, Artem Bilan
- 
Constructor SummaryConstructorsConstructorDescriptionRedisChannelMessageStore(RedisConnectionFactory connectionFactory) Construct a message store that uses Java Serialization for messages.
- 
Method SummaryModifier and TypeMethodDescriptionaddMessageToGroup(Object groupId, Message<?> message) Store a message with an association to a group id.voidprotected StringintgetMessageGroup(Object groupId) Return all Messages currently in the MessageStore that were stored usingBasicMessageGroupStore.addMessageToGroup(Object, Message)with this group id.intprotected MessageGroupFactoryprotected RedisTemplate<Object,Message<?>> intmessageGroupSize(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.voidremoveMessageGroup(Object groupId) Remove the message group with this id.voidsetBeanClassLoader(ClassLoader classLoader) voidsetBeanName(String name) voidsetMessageGroupFactory(MessageGroupFactory messageGroupFactory) Specify theMessageGroupFactoryto createMessageGroupobject where it is necessary.voidsetValueSerializer(RedisSerializer<?> valueSerializer) Use a different serializer (defaultJdkSerializationRedisSerializerfor theMessage.
- 
Constructor Details- 
RedisChannelMessageStoreConstruct a message store that uses Java Serialization for messages.- Parameters:
- connectionFactory- The redis connection factory.
 
 
- 
- 
Method Details- 
setBeanClassLoader- Specified by:
- setBeanClassLoaderin interface- BeanClassLoaderAware
 
- 
setValueSerializerUse a different serializer (defaultJdkSerializationRedisSerializerfor theMessage.- Parameters:
- valueSerializer- The value serializer.
 
- 
setMessageGroupFactorySpecify theMessageGroupFactoryto createMessageGroupobject where it is necessary. Defaults toSimpleMessageGroupFactory.- Parameters:
- messageGroupFactory- the- MessageGroupFactoryto use.
- Since:
- 4.3
 
- 
getMessageGroupFactory
- 
setBeanName- Specified by:
- setBeanNamein interface- BeanNameAware
 
- 
getBeanName
- 
getRedisTemplate
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- InitializingBean
 
- 
messageGroupSizeDescription copied from interface:BasicMessageGroupStoreReturn the size of this MessageGroup.- Specified by:
- messageGroupSizein interface- BasicMessageGroupStore
- Parameters:
- groupId- The group identifier.
- Returns:
- The size.
 
- 
getMessageGroupDescription copied from interface:BasicMessageGroupStoreReturn all Messages currently in the MessageStore that were stored usingBasicMessageGroupStore.addMessageToGroup(Object, Message)with this group id.- Specified by:
- getMessageGroupin interface- BasicMessageGroupStore
- Parameters:
- groupId- The group identifier.
- Returns:
- A group of messages, empty if none exists for this key.
 
- 
addMessageToGroupDescription copied from interface:BasicMessageGroupStoreStore a message with an association to a group id. This can be used to group messages together.- Specified by:
- addMessageToGroupin interface- BasicMessageGroupStore
- Parameters:
- groupId- The group id to store the message under.
- message- A message.
- Returns:
- The message group.
 
- 
removeMessageGroupDescription copied from interface:BasicMessageGroupStoreRemove the message group with this id.- Specified by:
- removeMessageGroupin interface- BasicMessageGroupStore
- Parameters:
- groupId- The id of the group to remove.
 
- 
pollMessageFromGroupDescription copied from interface:BasicMessageGroupStorePoll Message from thisMessageGroup(in FIFO style if supported by the implementation) while also removing the polledMessage.- Specified by:
- pollMessageFromGroupin interface- BasicMessageGroupStore
- Parameters:
- groupId- The group identifier.
- Returns:
- The message.
 
- 
getMessageCountForAllMessageGroups
- 
getMessageGroupCount
 
-