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<MessageGroup>,- Aware,- InitializingBean,- ApplicationContextAware,- BasicMessageGroupStore,- MessageGroupStore
- Direct Known Subclasses:
- ConfigurableMongoDbMessageStore,- MongoDbChannelMessageStore
public abstract class AbstractConfigurableMongoDbMessageStore
extends AbstractMessageGroupStore
implements InitializingBean, ApplicationContextAware
The abstract MongoDB 
AbstractMessageGroupStore implementation to provide configuration for common options
 for implementations of this class.- Since:
- 4.0
- Author:
- Artem Bilan, Adama Sorho
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.store.MessageGroupStoreMessageGroupStore.MessageGroupCallback
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Stringprotected final Logprotected final MongoDatabaseFactorystatic final String
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate, String collectionName) AbstractConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, String collectionName) AbstractConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter, String collectionName) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddMessageDocument(MessageDocument document) voidaddMessagesToGroup(Object groupId, Message<?>... messages) Store messages with an association to a group id.voidvoidcompleteGroup(Object groupId) Completes this MessageGroup.protected voidprotected ApplicationContextprotected MappingMongoConverterMessage<?>getMessage(UUID id) protected MessageBuilderFactoryCollection<Message<?>>getMessagesForGroup(Object groupId) Retrieve messages for the provided group id.protected MongoTemplateprotected longPerform MongoDBINCoperation for the document, which contains theMessageDocumentsequence, and return the new incremented value for the newMessageDocument.Message<?>getOneMessageFromGroup(Object groupId) Return the oneMessagefromMessageGroup.protected static QuerygroupIdQuery(Object groupId) iterator()intmessageGroupSize(Object groupId) Return the size of this MessageGroup.voidremoveMessageGroup(Object groupId) Remove the message group with this id.voidremoveMessagesFromGroup(Object key, Collection<Message<?>> messages) Persist the deletion of messages from the group.voidsetApplicationContext(ApplicationContext applicationContext) voidsetCreateIndexes(boolean createIndexes) Define the option to auto create indexes or not.voidsetGroupCondition(Object groupId, String condition) Add a condition sentence into the group.voidsetLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber) Allows you to set the sequence number of the last released Message.Methods inherited from class org.springframework.integration.store.AbstractMessageGroupStoreaddMessageToGroup, copy, 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.BasicMessageGroupStoregetMessageGroup, pollMessageFromGroupMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.springframework.integration.store.MessageGroupStorestreamMessagesForGroup
- 
Field Details- 
SEQUENCE_NAME- See Also:
 
- 
logger
- 
collectionName
- 
mongoDbFactory
 
- 
- 
Constructor Details- 
AbstractConfigurableMongoDbMessageStore
- 
AbstractConfigurableMongoDbMessageStorepublic AbstractConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, String collectionName) 
- 
AbstractConfigurableMongoDbMessageStorepublic AbstractConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter, String collectionName) 
 
- 
- 
Method Details- 
setCreateIndexespublic void setCreateIndexes(boolean createIndexes) Define the option to auto create indexes or not.- Parameters:
- createIndexes- a boolean.
- Since:
- 6.0.8.
 
- 
setApplicationContext- Specified by:
- setApplicationContextin interface- ApplicationContextAware
- Throws:
- BeansException
 
- 
getMongoTemplate
- 
getMappingMongoConverter
- 
getApplicationContext
- 
getMessageBuilderFactory
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- InitializingBean
 
- 
createIndexesprotected void createIndexes()
- 
getMessage
- 
getMessageMetadata
- 
removeMessageGroupDescription copied from interface:BasicMessageGroupStoreRemove the message group with this id.- Specified by:
- removeMessageGroupin interface- BasicMessageGroupStore
- Parameters:
- groupId- The id of the group to remove.
 
- 
messageGroupSizeDescription copied from interface:BasicMessageGroupStoreReturn the size of this MessageGroup.- Specified by:
- messageGroupSizein interface- BasicMessageGroupStore
- Parameters:
- groupId- The group identifier.
- Returns:
- The size.
 
- 
getNextIdprotected long getNextId()Perform MongoDBINCoperation for the document, which contains theMessageDocumentsequence, and return the new incremented value for the newMessageDocument. TheSEQUENCE_NAMEdocument is created on demand.- Returns:
- the next sequence value.
 
- 
addMessageDocument
- 
groupIdQuery
- 
removeMessagesFromGroupDescription copied from interface:MessageGroupStorePersist the deletion of messages from the group.- Specified by:
- removeMessagesFromGroupin interface- MessageGroupStore
- Parameters:
- key- The groupId for the group containing the message(s).
- messages- The messages to be removed.
 
- 
setGroupConditionDescription copied from interface:MessageGroupStoreAdd a condition sentence into the group. Can be used later on for making some decisions for group, e.g. release strategy for correlation handler can consult this condition instead of iterating all the messages in group.- Specified by:
- setGroupConditionin interface- MessageGroupStore
- Parameters:
- groupId- The group identifier.
- condition- The condition to store into the group.
 
- 
setLastReleasedSequenceNumberForGroupDescription copied from interface:MessageGroupStoreAllows you to set the sequence number of the last released Message. Used for Resequencing use cases- Specified by:
- setLastReleasedSequenceNumberForGroupin interface- MessageGroupStore
- Parameters:
- groupId- The group identifier.
- sequenceNumber- The sequence number.
 
- 
iterator- Specified by:
- iteratorin interface- Iterable<MessageGroup>
- Specified by:
- iteratorin interface- MessageGroupStore
- Returns:
- The iterator of currently accumulated MessageGroups.
 
- 
completeGroupDescription copied from interface:MessageGroupStoreCompletes this MessageGroup. Completion of the MessageGroup generally means that this group should not be allowing any more mutating operation to be performed on it. For example any attempt to add/remove new Message form the group should not be allowed.- Specified by:
- completeGroupin interface- MessageGroupStore
- Parameters:
- groupId- The group identifier.
 
- 
getOneMessageFromGroupDescription copied from interface:MessageGroupStoreReturn the oneMessagefromMessageGroup.- Specified by:
- getOneMessageFromGroupin interface- MessageGroupStore
- Parameters:
- groupId- The group identifier.
- Returns:
- the Message.
 
- 
addMessagesToGroupDescription copied from interface:MessageGroupStoreStore messages with an association to a group id. This can be used to group messages together.- Specified by:
- addMessagesToGroupin interface- MessageGroupStore
- Parameters:
- groupId- The group id to store messages under.
- messages- The messages to add.
 
- 
getMessagesForGroupDescription copied from interface:MessageGroupStoreRetrieve messages for the provided group id.- Specified by:
- getMessagesForGroupin interface- MessageGroupStore
- Parameters:
- groupId- The group id to retrieve messages for.
- Returns:
- the messages for group.
 
 
-