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 java.lang.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

    Constructors 
    Constructor Description
    RedisChannelMessageStore​(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
    Construct a message store that uses Java Serialization for messages.
  • Method Summary

    Modifier and Type Method 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 setBeanClassLoader​(java.lang.ClassLoader classLoader)  
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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​(java.lang.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​(java.lang.String name)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • getBeanName

      protected java.lang.String getBeanName()
    • getRedisTemplate

      protected org.springframework.data.redis.core.RedisTemplate<java.lang.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​(java.lang.Object groupId)
      Specified by:
      messageGroupSize in interface org.springframework.integration.store.BasicMessageGroupStore
    • getMessageGroup

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

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

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

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

      @ManagedAttribute public int getMessageCountForAllMessageGroups()
    • getMessageGroupCount

      @ManagedAttribute public int getMessageGroupCount()