public class RedisChannelMessageStore
extends java.lang.Object
implements org.springframework.integration.store.ChannelMessageStore, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
ChannelMessageStore that uses a list to back a QueueChannel.
Requires setBeanName(String) which is used as part of the key.
| Constructor and Description |
|---|
RedisChannelMessageStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
Construct a message store that uses Java Serialization for messages.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.integration.store.MessageGroup |
addMessageToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?> message) |
void |
afterPropertiesSet() |
protected java.lang.String |
getBeanName() |
int |
getMessageCountForAllMessageGroups() |
org.springframework.integration.store.MessageGroup |
getMessageGroup(java.lang.Object groupId) |
int |
getMessageGroupCount() |
protected org.springframework.integration.store.MessageGroupFactory |
getMessageGroupFactory() |
protected org.springframework.data.redis.core.RedisTemplate<java.lang.Object,org.springframework.messaging.Message<?>> |
getRedisTemplate() |
int |
messageGroupSize(java.lang.Object groupId) |
org.springframework.messaging.Message<?> |
pollMessageFromGroup(java.lang.Object groupId) |
void |
removeMessageGroup(java.lang.Object groupId) |
void |
setBeanName(java.lang.String name) |
void |
setMessageGroupFactory(org.springframework.integration.store.MessageGroupFactory messageGroupFactory)
Specify the
MessageGroupFactory to create MessageGroup object where
it is necessary. |
void |
setValueSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> valueSerializer)
Use a different serializer (default
JdkSerializationRedisSerializer for
the Message. |
public RedisChannelMessageStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
connectionFactory - The redis connection factory.public void setValueSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> valueSerializer)
JdkSerializationRedisSerializer for
the Message.valueSerializer - The value serializer.public void setMessageGroupFactory(org.springframework.integration.store.MessageGroupFactory messageGroupFactory)
MessageGroupFactory to create MessageGroup object where
it is necessary.
Defaults to SimpleMessageGroupFactory.messageGroupFactory - the MessageGroupFactory to use.protected org.springframework.integration.store.MessageGroupFactory getMessageGroupFactory()
public void setBeanName(java.lang.String name)
setBeanName in interface org.springframework.beans.factory.BeanNameAwareprotected java.lang.String getBeanName()
protected org.springframework.data.redis.core.RedisTemplate<java.lang.Object,org.springframework.messaging.Message<?>> getRedisTemplate()
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exception@ManagedAttribute public int messageGroupSize(java.lang.Object groupId)
messageGroupSize in interface org.springframework.integration.store.BasicMessageGroupStorepublic org.springframework.integration.store.MessageGroup getMessageGroup(java.lang.Object groupId)
getMessageGroup in interface org.springframework.integration.store.BasicMessageGroupStorepublic org.springframework.integration.store.MessageGroup addMessageToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?> message)
addMessageToGroup in interface org.springframework.integration.store.BasicMessageGroupStorepublic void removeMessageGroup(java.lang.Object groupId)
removeMessageGroup in interface org.springframework.integration.store.BasicMessageGroupStorepublic org.springframework.messaging.Message<?> pollMessageFromGroup(java.lang.Object groupId)
pollMessageFromGroup in interface org.springframework.integration.store.BasicMessageGroupStore@ManagedAttribute public int getMessageCountForAllMessageGroups()
@ManagedAttribute public int getMessageGroupCount()