Class MongoDbChannelMessageStore

java.lang.Object
org.springframework.integration.store.AbstractBatchingMessageGroupStore
org.springframework.integration.store.AbstractMessageGroupStore
org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore
org.springframework.integration.mongodb.store.MongoDbChannelMessageStore
All Implemented Interfaces:
java.lang.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.ChannelMessageStore, org.springframework.integration.store.MessageGroupStore, org.springframework.integration.store.PriorityCapableChannelMessageStore

public class MongoDbChannelMessageStore
extends AbstractConfigurableMongoDbMessageStore
implements org.springframework.integration.store.PriorityCapableChannelMessageStore
MongoDB PriorityCapableChannelMessageStore implementation. This message store shall be used for message channels only.

Provide the priorityEnabled option to allow to poll messages via priority manner.

As a priority document field the IntegrationMessageHeaderAccessor.PRIORITY message header is used.

The same collection can be used for org.springframework.integration.channel.QueueChannels and org.springframework.integration.channel.PriorityChannels, but the different instances of MongoDbChannelMessageStore should be used for those cases, and the last one with priorityEnabled = true option.

Since:
4.0
  • Field Details

  • Constructor Details

    • MongoDbChannelMessageStore

      public MongoDbChannelMessageStore​(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)
    • MongoDbChannelMessageStore

      public MongoDbChannelMessageStore​(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, java.lang.String collectionName)
    • MongoDbChannelMessageStore

      public MongoDbChannelMessageStore​(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory)
    • MongoDbChannelMessageStore

      public MongoDbChannelMessageStore​(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter)
    • MongoDbChannelMessageStore

      public MongoDbChannelMessageStore​(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, java.lang.String collectionName)
    • MongoDbChannelMessageStore

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

    • setPriorityEnabled

      public void setPriorityEnabled​(boolean priorityEnabled)
    • isPriorityEnabled

      public boolean isPriorityEnabled()
      Specified by:
      isPriorityEnabled in interface org.springframework.integration.store.PriorityCapableChannelMessageStore
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class AbstractConfigurableMongoDbMessageStore
    • 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
      Overrides:
      addMessageToGroup in class org.springframework.integration.store.AbstractMessageGroupStore
    • getMessageGroup

      public org.springframework.integration.store.MessageGroup getMessageGroup​(java.lang.Object groupId)
      Not fully used. Only wraps the provided group id.
      Specified by:
      getMessageGroup 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