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

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

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

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

      public void removeMessageGroup(Object groupId)
      Specified by:
      removeMessageGroup in interface org.springframework.integration.store.BasicMessageGroupStore
    • 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)
    • removeMessagesFromGroup

      public void removeMessagesFromGroup(Object key, Collection<org.springframework.messaging.Message<?>> messages)
      Specified by:
      removeMessagesFromGroup in interface org.springframework.integration.store.MessageGroupStore
    • setGroupCondition

      public void setGroupCondition(Object groupId, String condition)
      Specified by:
      setGroupCondition in interface org.springframework.integration.store.MessageGroupStore
    • setLastReleasedSequenceNumberForGroup

      public void setLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber)
      Specified by:
      setLastReleasedSequenceNumberForGroup in interface org.springframework.integration.store.MessageGroupStore
    • 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
    • completeGroup

      public void completeGroup(Object groupId)
      Specified by:
      completeGroup in interface org.springframework.integration.store.MessageGroupStore
    • getOneMessageFromGroup

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

      public void addMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages)
      Specified by:
      addMessagesToGroup in interface org.springframework.integration.store.MessageGroupStore
    • getMessagesForGroup

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