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
ConstructorDescriptionRedisChannelMessageStore
(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.MessageGroup
addMessageToGroup
(Object groupId, org.springframework.messaging.Message<?> message) void
protected String
int
org.springframework.integration.store.MessageGroup
getMessageGroup
(Object groupId) int
protected org.springframework.integration.store.MessageGroupFactory
protected org.springframework.data.redis.core.RedisTemplate<Object,
org.springframework.messaging.Message<?>> int
messageGroupSize
(Object groupId) org.springframework.messaging.Message<?>
pollMessageFromGroup
(Object groupId) void
removeMessageGroup
(Object groupId) void
setBeanClassLoader
(ClassLoader classLoader) void
setBeanName
(String name) void
setMessageGroupFactory
(org.springframework.integration.store.MessageGroupFactory messageGroupFactory) Specify theMessageGroupFactory
to createMessageGroup
object where it is necessary.void
setValueSerializer
(org.springframework.data.redis.serializer.RedisSerializer<?> valueSerializer) Use a different serializer (defaultJdkSerializationRedisSerializer
for 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:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
setValueSerializer
public void setValueSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> valueSerializer) Use a different serializer (defaultJdkSerializationRedisSerializer
for theMessage
.- Parameters:
valueSerializer
- The value serializer.
-
setMessageGroupFactory
public void setMessageGroupFactory(org.springframework.integration.store.MessageGroupFactory messageGroupFactory) Specify theMessageGroupFactory
to createMessageGroup
object where it is necessary. Defaults toSimpleMessageGroupFactory
.- Parameters:
messageGroupFactory
- theMessageGroupFactory
to use.- Since:
- 4.3
-
getMessageGroupFactory
protected org.springframework.integration.store.MessageGroupFactory getMessageGroupFactory() -
setBeanName
- Specified by:
setBeanName
in 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:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
messageGroupSize
- Specified by:
messageGroupSize
in interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
getMessageGroup
- Specified by:
getMessageGroup
in interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
addMessageToGroup
public org.springframework.integration.store.MessageGroup addMessageToGroup(Object groupId, org.springframework.messaging.Message<?> message) - Specified by:
addMessageToGroup
in interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
removeMessageGroup
- Specified by:
removeMessageGroup
in interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
pollMessageFromGroup
- Specified by:
pollMessageFromGroup
in interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
getMessageCountForAllMessageGroups
@ManagedAttribute public int getMessageCountForAllMessageGroups() -
getMessageGroupCount
@ManagedAttribute public int getMessageGroupCount()
-