Class AbstractConfigurableMongoDbMessageStore

java.lang.Object
org.springframework.integration.store.AbstractBatchingMessageGroupStore
org.springframework.integration.store.AbstractMessageGroupStore
org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore
All Implemented Interfaces:
Iterable<org.springframework.integration.store.MessageGroup>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.integration.store.BasicMessageGroupStore, org.springframework.integration.store.MessageGroupStore
Direct Known Subclasses:
ConfigurableMongoDbMessageStore, MongoDbChannelMessageStore

public abstract class AbstractConfigurableMongoDbMessageStore extends org.springframework.integration.store.AbstractMessageGroupStore implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
The abstract MongoDB AbstractMessageGroupStore implementation to provide configuration for common options for implementations of this class.
Since:
4.0
  • Nested Class Summary

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

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

    Fields
    Modifier and Type
    Field
    Description
    protected final String
     
    protected final org.apache.commons.logging.Log
     
    protected final org.springframework.data.mongodb.MongoDatabaseFactory
     
    static final String
     

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

    GROUP_ID_MUST_NOT_BE_NULL, INTERRUPTED_WHILE_OBTAINING_LOCK
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, String collectionName)
     
    AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, String collectionName)
     
    AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, String collectionName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    void
     
    protected void
     
    protected void
    doAddMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages)
     
    protected void
     
    protected void
     
    protected void
    doRemoveMessagesFromGroup(Object key, Collection<org.springframework.messaging.Message<?>> messages)
     
    protected void
    doSetGroupCondition(Object groupId, String condition)
     
    protected void
    doSetLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber)
     
    protected org.springframework.context.ApplicationContext
     
    protected org.springframework.data.mongodb.core.convert.MappingMongoConverter
     
    org.springframework.messaging.Message<?>
     
    protected org.springframework.integration.support.MessageBuilderFactory
     
    org.springframework.integration.store.MessageMetadata
     
    Collection<org.springframework.messaging.Message<?>>
     
    protected org.springframework.data.mongodb.core.MongoTemplate
     
    protected long
    Perform MongoDB INC operation for the document, which contains the MessageDocument sequence, and return the new incremented value for the new MessageDocument.
    org.springframework.messaging.Message<?>
     
    protected static org.springframework.data.mongodb.core.query.Query
     
    Iterator<org.springframework.integration.store.MessageGroup>
     
    int
     
    void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     
    void
    setCreateIndexes(boolean createIndexes)
    Define the option to auto create indexes or not.

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

    addMessagesToGroup, addMessageToGroup, completeGroup, copy, doPollMessageFromGroup, doRemoveMessageFromGroupById, executeLocked, executeLocked, expireMessageGroups, getGroupMetadata, getLockRegistry, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, pollMessageFromGroup, registerMessageGroupExpiryCallback, removeMessageFromGroupById, removeMessageGroup, removeMessagesFromGroup, removeMessagesFromGroup, setExpiryCallbacks, setGroupCondition, setLastReleasedSequenceNumberForGroup, setLazyLoadMessageGroups, setLockRegistry, 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 org.springframework.integration.store.BasicMessageGroupStore

    getMessageGroup

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface org.springframework.integration.store.MessageGroupStore

    getMessageFromGroup, streamMessagesForGroup
  • Field Details

    • SEQUENCE_NAME

      public static final String SEQUENCE_NAME
      See Also:
    • logger

      protected final org.apache.commons.logging.Log logger
    • collectionName

      protected final String collectionName
    • mongoDbFactory

      protected final org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory
  • Constructor Details

    • AbstractConfigurableMongoDbMessageStore

      public AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, String collectionName)
    • AbstractConfigurableMongoDbMessageStore

      public AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, String collectionName)
    • AbstractConfigurableMongoDbMessageStore

      public AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, String collectionName)
  • Method Details

    • setCreateIndexes

      public void setCreateIndexes(boolean createIndexes)
      Define the option to auto create indexes or not.
      Parameters:
      createIndexes - a boolean.
      Since:
      6.0.8.
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • getMongoTemplate

      protected org.springframework.data.mongodb.core.MongoTemplate getMongoTemplate()
    • getMappingMongoConverter

      protected org.springframework.data.mongodb.core.convert.MappingMongoConverter getMappingMongoConverter()
    • getApplicationContext

      protected org.springframework.context.ApplicationContext getApplicationContext()
    • getMessageBuilderFactory

      protected org.springframework.integration.support.MessageBuilderFactory getMessageBuilderFactory()
    • afterPropertiesSet

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

      protected void createIndexes()
    • getMessage

      public org.springframework.messaging.Message<?> getMessage(UUID id)
    • getMessageMetadata

      public org.springframework.integration.store.MessageMetadata getMessageMetadata(UUID id)
    • doRemoveMessageGroup

      protected void doRemoveMessageGroup(Object groupId)
      Specified by:
      doRemoveMessageGroup in class org.springframework.integration.store.AbstractMessageGroupStore
    • messageGroupSize

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

      protected long getNextId()
      Perform MongoDB INC operation for the document, which contains the MessageDocument sequence, and return the new incremented value for the new MessageDocument. The SEQUENCE_NAME document is created on demand.
      Returns:
      the next sequence value.
    • addMessageDocument

      protected void addMessageDocument(MessageDocument document)
    • groupIdQuery

      protected static org.springframework.data.mongodb.core.query.Query groupIdQuery(Object groupId)
    • doRemoveMessagesFromGroup

      protected void doRemoveMessagesFromGroup(Object key, Collection<org.springframework.messaging.Message<?>> messages)
      Specified by:
      doRemoveMessagesFromGroup in class org.springframework.integration.store.AbstractMessageGroupStore
    • doSetGroupCondition

      protected void doSetGroupCondition(Object groupId, String condition)
      Specified by:
      doSetGroupCondition in class org.springframework.integration.store.AbstractMessageGroupStore
    • doSetLastReleasedSequenceNumberForGroup

      protected void doSetLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber)
      Specified by:
      doSetLastReleasedSequenceNumberForGroup in class org.springframework.integration.store.AbstractMessageGroupStore
    • iterator

      public Iterator<org.springframework.integration.store.MessageGroup> iterator()
      Specified by:
      iterator in interface Iterable<org.springframework.integration.store.MessageGroup>
      Specified by:
      iterator in interface org.springframework.integration.store.MessageGroupStore
    • doCompleteGroup

      protected void doCompleteGroup(Object groupId)
      Specified by:
      doCompleteGroup in class org.springframework.integration.store.AbstractMessageGroupStore
    • getOneMessageFromGroup

      public org.springframework.messaging.Message<?> getOneMessageFromGroup(Object groupId)
      Specified by:
      getOneMessageFromGroup in interface org.springframework.integration.store.MessageGroupStore
    • doAddMessagesToGroup

      protected void doAddMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages)
      Specified by:
      doAddMessagesToGroup in class org.springframework.integration.store.AbstractMessageGroupStore
    • getMessagesForGroup

      public Collection<org.springframework.messaging.Message<?>> getMessagesForGroup(Object groupId)
      Specified by:
      getMessagesForGroup in interface org.springframework.integration.store.MessageGroupStore