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:
- Iterable<MessageGroup>,- Aware,- InitializingBean,- ApplicationContextAware,- BasicMessageGroupStore,- ChannelMessageStore,- MessageGroupStore,- PriorityCapableChannelMessageStore
public class MongoDbChannelMessageStore
extends AbstractConfigurableMongoDbMessageStore
implements 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
- Author:
- Artem Bilan, Adama Sorho
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.store.MessageGroupStoreMessageGroupStore.MessageGroupCallback
- 
Field SummaryFieldsFields inherited from class org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStorecollectionName, logger, mongoDbFactory, SEQUENCE_NAME
- 
Constructor SummaryConstructorsConstructorDescriptionMongoDbChannelMessageStore(MongoTemplate mongoTemplate) MongoDbChannelMessageStore(MongoTemplate mongoTemplate, String collectionName) MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory) MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory, String collectionName) MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter) MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter, String collectionName) 
- 
Method SummaryModifier and TypeMethodDescriptionaddMessageToGroup(Object groupId, Message<?> message) Store a message with an association to a group id.protected voidgetMessageGroup(Object groupId) Not fully used.booleanMessage<?>pollMessageFromGroup(Object groupId) Poll Message from thisMessageGroup(in FIFO style if supported by the implementation) while also removing the polledMessage.voidsetPriorityEnabled(boolean priorityEnabled) Methods inherited from class org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStoreaddMessageDocument, addMessagesToGroup, afterPropertiesSet, completeGroup, getApplicationContext, getMappingMongoConverter, getMessage, getMessageBuilderFactory, getMessageMetadata, getMessagesForGroup, getMongoTemplate, getNextId, getOneMessageFromGroup, groupIdQuery, iterator, messageGroupSize, removeMessageGroup, removeMessagesFromGroup, setApplicationContext, setCreateIndexes, setGroupCondition, setLastReleasedSequenceNumberForGroupMethods inherited from class org.springframework.integration.store.AbstractMessageGroupStorecopy, expireMessageGroups, getGroupMetadata, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, setTimeoutOnIdleMethods inherited from class org.springframework.integration.store.AbstractBatchingMessageGroupStoregetRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSizeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.store.BasicMessageGroupStoremessageGroupSize, removeMessageGroupMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.springframework.integration.store.MessageGroupStorestreamMessagesForGroup
- 
Field Details- 
DEFAULT_COLLECTION_NAMEThe default conventional collection name.- See Also:
 
 
- 
- 
Constructor Details- 
MongoDbChannelMessageStore
- 
MongoDbChannelMessageStore
- 
MongoDbChannelMessageStore
- 
MongoDbChannelMessageStorepublic MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter) 
- 
MongoDbChannelMessageStore
- 
MongoDbChannelMessageStorepublic MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter, String collectionName) 
 
- 
- 
Method Details- 
setPriorityEnabledpublic void setPriorityEnabled(boolean priorityEnabled) 
- 
isPriorityEnabledpublic boolean isPriorityEnabled()- Specified by:
- isPriorityEnabledin interface- PriorityCapableChannelMessageStore
- Returns:
- true if message priority is enabled in this channel message store.
 
- 
createIndexesprotected void createIndexes()- Overrides:
- createIndexesin class- AbstractConfigurableMongoDbMessageStore
 
- 
addMessageToGroupDescription copied from interface:BasicMessageGroupStoreStore a message with an association to a group id. This can be used to group messages together.- Specified by:
- addMessageToGroupin interface- BasicMessageGroupStore
- Overrides:
- addMessageToGroupin class- AbstractMessageGroupStore
- Parameters:
- groupId- The group id to store the message under.
- message- A message.
- Returns:
- The message group.
 
- 
getMessageGroupNot fully used. Only wraps the provided group id.- Specified by:
- getMessageGroupin interface- BasicMessageGroupStore
- Parameters:
- groupId- The group identifier.
- Returns:
- A group of messages, empty if none exists for this key.
 
- 
pollMessageFromGroupDescription copied from interface:BasicMessageGroupStorePoll Message from thisMessageGroup(in FIFO style if supported by the implementation) while also removing the polledMessage.- Specified by:
- pollMessageFromGroupin interface- BasicMessageGroupStore
- Parameters:
- groupId- The group identifier.
- Returns:
- The message.
 
 
-