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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.store.MessageGroupStore
org.springframework.integration.store.MessageGroupStore.MessageGroupCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final org.apache.commons.logging.Logprotected final org.springframework.data.mongodb.MongoDatabaseFactorystatic final StringFields inherited from class org.springframework.integration.store.AbstractMessageGroupStore
GROUP_ID_MUST_NOT_BE_NULL, INTERRUPTED_WHILE_OBTAINING_LOCK -
Constructor Summary
ConstructorsConstructorDescriptionAbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, String collectionName) AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, String collectionName) AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, String collectionName) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMessageDocument(MessageDocument document) voidprotected voidprotected voiddoAddMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages) protected voiddoCompleteGroup(Object groupId) protected voiddoRemoveMessageGroup(Object groupId) protected voiddoRemoveMessagesFromGroup(Object key, Collection<org.springframework.messaging.Message<?>> messages) protected voiddoSetGroupCondition(Object groupId, String condition) protected voiddoSetLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber) protected org.springframework.context.ApplicationContextprotected org.springframework.data.mongodb.core.convert.MappingMongoConverterorg.springframework.messaging.Message<?>getMessage(UUID id) protected org.springframework.integration.support.MessageBuilderFactoryorg.springframework.integration.store.MessageMetadataCollection<org.springframework.messaging.Message<?>>getMessagesForGroup(Object groupId) protected org.springframework.data.mongodb.core.MongoTemplateprotected longPerform MongoDBINCoperation for the document, which contains theMessageDocumentsequence, and return the new incremented value for the newMessageDocument.org.springframework.messaging.Message<?>getOneMessageFromGroup(Object groupId) protected static org.springframework.data.mongodb.core.query.QuerygroupIdQuery(Object groupId) Iterator<org.springframework.integration.store.MessageGroup>iterator()intmessageGroupSize(Object groupId) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetCreateIndexes(boolean createIndexes) Define the option to auto create indexes or not.Methods inherited from class org.springframework.integration.store.AbstractMessageGroupStore
addMessagesToGroup, 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.AbstractBatchingMessageGroupStore
getRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.store.BasicMessageGroupStore
getMessageGroupMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.springframework.integration.store.MessageGroupStore
getMessageFromGroup, streamMessagesForGroup
-
Field Details
-
SEQUENCE_NAME
- See Also:
-
logger
protected final org.apache.commons.logging.Log logger -
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
-
setCreateIndexes
public void setCreateIndexes(boolean createIndexes) Define the option to auto create indexes or not.- Parameters:
createIndexes- a boolean.- Since:
- 6.0.8.
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.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:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
createIndexes
protected void createIndexes() -
getMessage
-
getMessageMetadata
-
doRemoveMessageGroup
- Specified by:
doRemoveMessageGroupin classorg.springframework.integration.store.AbstractMessageGroupStore
-
messageGroupSize
- Specified by:
messageGroupSizein interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
getNextId
protected 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
protected void doRemoveMessagesFromGroup(Object key, Collection<org.springframework.messaging.Message<?>> messages) - Specified by:
doRemoveMessagesFromGroupin classorg.springframework.integration.store.AbstractMessageGroupStore
-
doSetGroupCondition
- Specified by:
doSetGroupConditionin classorg.springframework.integration.store.AbstractMessageGroupStore
-
doSetLastReleasedSequenceNumberForGroup
- Specified by:
doSetLastReleasedSequenceNumberForGroupin classorg.springframework.integration.store.AbstractMessageGroupStore
-
iterator
-
doCompleteGroup
- Specified by:
doCompleteGroupin classorg.springframework.integration.store.AbstractMessageGroupStore
-
getOneMessageFromGroup
- Specified by:
getOneMessageFromGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
doAddMessagesToGroup
protected void doAddMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages) - Specified by:
doAddMessagesToGroupin classorg.springframework.integration.store.AbstractMessageGroupStore
-
getMessagesForGroup
- Specified by:
getMessagesForGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-