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 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

      public void setBeanClassLoader(ClassLoader classLoader)
      Specified by:
      setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware
    • setValueSerializer

      public void setValueSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> valueSerializer)
      Use a different serializer (default JdkSerializationRedisSerializer for the Message.
      Parameters:
      valueSerializer - The value serializer.
    • setMessageGroupFactory

      public void setMessageGroupFactory(org.springframework.integration.store.MessageGroupFactory messageGroupFactory)
      Specify the MessageGroupFactory to create MessageGroup object where it is necessary. Defaults to SimpleMessageGroupFactory.
      Parameters:
      messageGroupFactory - the MessageGroupFactory to use.
      Since:
      4.3
    • getMessageGroupFactory

      protected org.springframework.integration.store.MessageGroupFactory getMessageGroupFactory()
    • setBeanName

      public void setBeanName(String name)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • getBeanName

      protected String getBeanName()
    • getRedisTemplate

      protected org.springframework.data.redis.core.RedisTemplate<Object,org.springframework.messaging.Message<?>> getRedisTemplate()
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • messageGroupSize

      @ManagedAttribute public int messageGroupSize(Object groupId)
      Specified by:
      messageGroupSize in interface org.springframework.integration.store.BasicMessageGroupStore
    • getMessageGroup

      public org.springframework.integration.store.MessageGroup getMessageGroup(Object groupId)
      Specified by:
      getMessageGroup in interface org.springframework.integration.store.BasicMessageGroupStore
    • addMessageToGroup

      public org.springframework.integration.store.MessageGroup addMessageToGroup(Object groupId, org.springframework.messaging.Message<?> message)
      Specified by:
      addMessageToGroup in interface org.springframework.integration.store.BasicMessageGroupStore
    • removeMessageGroup

      public void removeMessageGroup(Object groupId)
      Specified by:
      removeMessageGroup in interface org.springframework.integration.store.BasicMessageGroupStore
    • pollMessageFromGroup

      public org.springframework.messaging.Message<?> pollMessageFromGroup(Object groupId)
      Specified by:
      pollMessageFromGroup in interface org.springframework.integration.store.BasicMessageGroupStore
    • getMessageCountForAllMessageGroups

      @ManagedAttribute public int getMessageCountForAllMessageGroups()
    • getMessageGroupCount

      @ManagedAttribute public int getMessageGroupCount()