Class RedisChannelMessageStore
java.lang.Object
org.springframework.integration.redis.store.RedisChannelMessageStore
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean,org.springframework.integration.store.BasicMessageGroupStore,org.springframework.integration.store.ChannelMessageStore
- Direct Known Subclasses:
RedisChannelPriorityMessageStore
public class RedisChannelMessageStore
extends Object
implements org.springframework.integration.store.ChannelMessageStore, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.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
-
Constructor Summary
ConstructorsConstructorDescriptionRedisChannelMessageStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory) Construct a message store that uses Java Serialization for messages. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.integration.store.MessageGroupaddMessageToGroup(Object groupId, org.springframework.messaging.Message<?> message) voidprotected Stringintorg.springframework.integration.store.MessageGroupgetMessageGroup(Object groupId) intprotected org.springframework.integration.store.MessageGroupFactoryprotected org.springframework.data.redis.core.RedisTemplate<Object,org.springframework.messaging.Message<?>> intmessageGroupSize(Object groupId) org.springframework.messaging.Message<?>pollMessageFromGroup(Object groupId) voidremoveMessageGroup(Object groupId) voidsetBeanClassLoader(ClassLoader classLoader) voidsetBeanName(String name) voidsetMessageGroupFactory(org.springframework.integration.store.MessageGroupFactory messageGroupFactory) Specify theMessageGroupFactoryto createMessageGroupobject where it is necessary.voidsetValueSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> valueSerializer) Use a different serializer (defaultJdkSerializationRedisSerializerfor theMessage.
-
Constructor Details
-
RedisChannelMessageStore
public RedisChannelMessageStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory) Construct a message store that uses Java Serialization for messages.- Parameters:
connectionFactory- The redis connection factory.
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
setValueSerializer
public void setValueSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> valueSerializer) Use a different serializer (defaultJdkSerializationRedisSerializerfor theMessage.- Parameters:
valueSerializer- The value serializer.
-
setMessageGroupFactory
public void setMessageGroupFactory(org.springframework.integration.store.MessageGroupFactory messageGroupFactory) Specify theMessageGroupFactoryto createMessageGroupobject where it is necessary. Defaults toSimpleMessageGroupFactory.- Parameters:
messageGroupFactory- theMessageGroupFactoryto use.- Since:
- 4.3
-
getMessageGroupFactory
protected org.springframework.integration.store.MessageGroupFactory getMessageGroupFactory() -
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
getBeanName
-
getRedisTemplate
protected org.springframework.data.redis.core.RedisTemplate<Object,org.springframework.messaging.Message<?>> getRedisTemplate() -
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
messageGroupSize
- Specified by:
messageGroupSizein interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
getMessageGroup
- Specified by:
getMessageGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
addMessageToGroup
public org.springframework.integration.store.MessageGroup addMessageToGroup(Object groupId, org.springframework.messaging.Message<?> message) - Specified by:
addMessageToGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
removeMessageGroup
- Specified by:
removeMessageGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
pollMessageFromGroup
- Specified by:
pollMessageFromGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
getMessageCountForAllMessageGroups
@ManagedAttribute public int getMessageCountForAllMessageGroups() -
getMessageGroupCount
@ManagedAttribute public int getMessageGroupCount()
-