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, Youbin Wu
- 
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 StringFields inherited from class org.springframework.integration.store.AbstractMessageGroupStoreGROUP_ID_MUST_NOT_BE_NULL, INTERRUPTED_WHILE_OBTAINING_LOCK
- 
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) voidprotected voidprotected voiddoAddMessagesToGroup(Object groupId, Message<?>... messages) protected voiddoCompleteGroup(Object groupId) protected voiddoRemoveMessageGroup(Object groupId) protected voiddoRemoveMessagesFromGroup(Object key, Collection<Message<?>> messages) protected voiddoSetGroupCondition(Object groupId, String condition) protected voiddoSetLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber) protected 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.voidsetApplicationContext(ApplicationContext applicationContext) voidsetCreateIndexes(boolean createIndexes) Define the option to auto create indexes or not.Methods inherited from class org.springframework.integration.store.AbstractMessageGroupStoreaddMessagesToGroup, 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, 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.BasicMessageGroupStoregetMessageGroupMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.springframework.integration.store.MessageGroupStoregetMessageFromGroup, streamMessagesForGroup
- 
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
- 
doRemoveMessageGroup- Specified by:
- doRemoveMessageGroupin class- AbstractMessageGroupStore
 
- 
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
- 
doRemoveMessagesFromGroup- Specified by:
- doRemoveMessagesFromGroupin class- AbstractMessageGroupStore
 
- 
doSetGroupCondition- Specified by:
- doSetGroupConditionin class- AbstractMessageGroupStore
 
- 
doSetLastReleasedSequenceNumberForGroup- Specified by:
- doSetLastReleasedSequenceNumberForGroupin class- AbstractMessageGroupStore
 
- 
iterator- Specified by:
- iteratorin interface- Iterable<MessageGroup>
- Specified by:
- iteratorin interface- MessageGroupStore
- Returns:
- The iterator of currently accumulated MessageGroups.
 
- 
doCompleteGroup- Specified by:
- doCompleteGroupin class- AbstractMessageGroupStore
 
- 
getOneMessageFromGroupDescription copied from interface:MessageGroupStoreReturn the oneMessagefromMessageGroup.- Specified by:
- getOneMessageFromGroupin interface- MessageGroupStore
- Parameters:
- groupId- The group identifier.
- Returns:
- the Message.
 
- 
doAddMessagesToGroup- Specified by:
- doAddMessagesToGroupin class- AbstractMessageGroupStore
 
- 
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.
 
 
-