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
Fields -
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) voidaddMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages) voidvoidcompleteGroup(Object groupId) 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) voidremoveMessageGroup(Object groupId) voidremoveMessagesFromGroup(Object key, Collection<org.springframework.messaging.Message<?>> messages) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetGroupCondition(Object groupId, String condition) voidsetLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber) Methods inherited from class org.springframework.integration.store.AbstractMessageGroupStore
addMessageToGroup, copy, expireMessageGroups, getGroupMetadata, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, 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
getMessageGroup, pollMessageFromGroupMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.springframework.integration.store.MessageGroupStore
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
-
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
-
getMessage
-
getMessageMetadata
-
removeMessageGroup
- Specified by:
removeMessageGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
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
-
removeMessagesFromGroup
public void removeMessagesFromGroup(Object key, Collection<org.springframework.messaging.Message<?>> messages) - Specified by:
removeMessagesFromGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
setGroupCondition
- Specified by:
setGroupConditionin interfaceorg.springframework.integration.store.MessageGroupStore
-
setLastReleasedSequenceNumberForGroup
- Specified by:
setLastReleasedSequenceNumberForGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
iterator
-
completeGroup
- Specified by:
completeGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
getOneMessageFromGroup
- Specified by:
getOneMessageFromGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
addMessagesToGroup
public void addMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages) - Specified by:
addMessagesToGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
getMessagesForGroup
- Specified by:
getMessagesForGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-