Class RedisMessageStore

java.lang.Object
org.springframework.integration.store.AbstractBatchingMessageGroupStore
org.springframework.integration.store.AbstractMessageGroupStore
org.springframework.integration.store.AbstractKeyValueMessageStore
org.springframework.integration.redis.store.RedisMessageStore
All Implemented Interfaces:
Iterable<org.springframework.integration.store.MessageGroup>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.integration.store.BasicMessageGroupStore, org.springframework.integration.store.MessageGroupStore, org.springframework.integration.store.MessageStore

public class RedisMessageStore extends org.springframework.integration.store.AbstractKeyValueMessageStore implements org.springframework.beans.factory.BeanClassLoaderAware
Redis implementation of the key/value style MessageStore and MessageGroupStore
Since:
2.1
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.integration.store.MessageGroupStore

    org.springframework.integration.store.MessageGroupStore.MessageGroupCallback
  • Field Summary

    Fields inherited from class org.springframework.integration.store.AbstractKeyValueMessageStore

    MESSAGE_GROUP_KEY_PREFIX, MESSAGE_KEY_PREFIX

    Fields inherited from class org.springframework.integration.store.AbstractMessageGroupStore

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    RedisMessageStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
    Construct RedisMessageStore based on the provided RedisConnectionFactory and default empty prefix.
    RedisMessageStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, String prefix)
    Construct RedisMessageStore based on the provided RedisConnectionFactory and prefix.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Collection<?>
    doListKeys(String keyPattern)
     
    protected Object
     
    protected void
     
    protected Object
     
    protected void
    doStore(Object id, Object objectToStore)
     
    protected void
    doStoreIfAbsent(Object id, Object objectToStore)
     
    void
     
    void
    setValueSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> valueSerializer)
     

    Methods inherited from class org.springframework.integration.store.AbstractKeyValueMessageStore

    addMessage, addMessagesToGroup, completeGroup, doAddMessage, getGroupMetadata, getGroupPrefix, getMessage, getMessageCount, getMessageGroup, getMessageMetadata, getMessagePrefix, getMessagesForGroup, getOneMessageFromGroup, iterator, messageGroupSize, pollMessageFromGroup, removeMessage, removeMessageGroup, removeMessagesFromGroup, setGroupCondition, setLastReleasedSequenceNumberForGroup, streamMessagesForGroup

    Methods inherited from class org.springframework.integration.store.AbstractMessageGroupStore

    addMessageToGroup, copy, expireMessageGroups, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, setTimeoutOnIdle

    Methods inherited from class org.springframework.integration.store.AbstractBatchingMessageGroupStore

    getRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSize

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • RedisMessageStore

      public RedisMessageStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
      Construct RedisMessageStore based on the provided RedisConnectionFactory and default empty prefix.
      Parameters:
      connectionFactory - the RedisConnectionFactory to use
    • RedisMessageStore

      public RedisMessageStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, String prefix)
      Construct RedisMessageStore based on the provided RedisConnectionFactory and prefix.
      Parameters:
      connectionFactory - the RedisConnectionFactory to use
      prefix - the key prefix to use, allowing the same broker to be used for multiple stores.
      Since:
      4.3.12
      See Also:
      • AbstractKeyValueMessageStore(String)
  • 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)
    • doRetrieve

      protected Object doRetrieve(Object id)
      Specified by:
      doRetrieve in class org.springframework.integration.store.AbstractKeyValueMessageStore
    • doStore

      protected void doStore(Object id, Object objectToStore)
      Specified by:
      doStore in class org.springframework.integration.store.AbstractKeyValueMessageStore
    • doStoreIfAbsent

      protected void doStoreIfAbsent(Object id, Object objectToStore)
      Specified by:
      doStoreIfAbsent in class org.springframework.integration.store.AbstractKeyValueMessageStore
    • doRemove

      protected Object doRemove(Object id)
      Specified by:
      doRemove in class org.springframework.integration.store.AbstractKeyValueMessageStore
    • doRemoveAll

      protected void doRemoveAll(Collection<Object> ids)
      Specified by:
      doRemoveAll in class org.springframework.integration.store.AbstractKeyValueMessageStore
    • doListKeys

      protected Collection<?> doListKeys(String keyPattern)
      Specified by:
      doListKeys in class org.springframework.integration.store.AbstractKeyValueMessageStore