Class MongoDbMessageStore
java.lang.Object
org.springframework.integration.store.AbstractBatchingMessageGroupStore
org.springframework.integration.store.AbstractMessageGroupStore
org.springframework.integration.mongodb.store.MongoDbMessageStore
- All Implemented Interfaces:
Iterable<org.springframework.integration.store.MessageGroup>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.integration.store.BasicMessageGroupStore,org.springframework.integration.store.MessageGroupStore,org.springframework.integration.store.MessageStore
public class MongoDbMessageStore
extends org.springframework.integration.store.AbstractMessageGroupStore
implements org.springframework.integration.store.MessageStore, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
An implementation of both the
MessageStore and
MessageGroupStore
strategies that relies upon MongoDB for persistence.- Since:
- 2.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.store.MessageGroupStore
org.springframework.integration.store.MessageGroupStore.MessageGroupCallback -
Field Summary
FieldsFields inherited from class org.springframework.integration.store.AbstractMessageGroupStore
logger -
Constructor Summary
ConstructorsConstructorDescriptionMongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory) Create a MongoDbMessageStore using the providedMongoDatabaseFactory.and the default collection name.MongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, String collectionName) Create a MongoDbMessageStore using the providedMongoDatabaseFactoryand collection name. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllowedPatterns(String... patterns) Add patterns for packages/classes that are allowed to be deserialized.<T> org.springframework.messaging.Message<T>addMessage(org.springframework.messaging.Message<T> message) voidaddMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages) voidvoidcompleteGroup(Object groupId) org.springframework.messaging.Message<?>getMessage(UUID id) longintorg.springframework.integration.store.MessageGroupgetMessageGroup(Object groupId) intorg.springframework.integration.store.MessageMetadataCollection<org.springframework.messaging.Message<?>>getMessagesForGroup(Object groupId) org.springframework.messaging.Message<?>getOneMessageFromGroup(Object groupId) Iterator<org.springframework.integration.store.MessageGroup>iterator()intmessageGroupSize(Object groupId) org.springframework.messaging.Message<?>pollMessageFromGroup(Object groupId) org.springframework.messaging.Message<?>removeMessage(UUID id) voidremoveMessageGroup(Object groupId) voidremoveMessagesFromGroup(Object groupId, Collection<org.springframework.messaging.Message<?>> messages) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetBeanClassLoader(ClassLoader classLoader) voidsetCustomConverters(Object... customConverters) Configure a set of converters to use in theMappingMongoConverter.voidsetGroupCondition(Object groupId, String condition) voidsetLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber) Stream<org.springframework.messaging.Message<?>>streamMessagesForGroup(Object groupId) Methods inherited from class org.springframework.integration.store.AbstractMessageGroupStore
addMessageToGroup, copy, expireMessageGroups, getGroupMetadata, 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 java.lang.Iterable
forEach, spliterator
-
Field Details
-
SEQUENCE_NAME
- See Also:
-
-
Constructor Details
-
MongoDbMessageStore
public MongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory) Create a MongoDbMessageStore using the providedMongoDatabaseFactory.and the default collection name.- Parameters:
mongoDbFactory- The mongodb factory.
-
MongoDbMessageStore
public MongoDbMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, @Nullable String collectionName) Create a MongoDbMessageStore using the providedMongoDatabaseFactoryand collection name.- Parameters:
mongoDbFactory- The mongodb factory.collectionName- The collection name.
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
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
-
addAllowedPatterns
Add patterns for packages/classes that are allowed to be deserialized. A class can be fully qualified or a wildcard '*' is allowed at the beginning or end of the class name. Examples:com.foo.*,*.MyClass.- Parameters:
patterns- the patterns.- Since:
- 5.4
-
setCustomConverters
Configure a set of converters to use in theMappingMongoConverter. Must be instances oforg.springframework.core.convert.converter.Converter,org.springframework.core.convert.converter.ConverterFactory,org.springframework.core.convert.converter.GenericConverterororg.springframework.data.convert.ConverterBuilder.ConverterAware.- Parameters:
customConverters- the converters to use.- Since:
- 5.1.6
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
addMessage
public <T> org.springframework.messaging.Message<T> addMessage(org.springframework.messaging.Message<T> message) - Specified by:
addMessagein interfaceorg.springframework.integration.store.MessageStore
-
getMessage
- Specified by:
getMessagein interfaceorg.springframework.integration.store.MessageStore
-
getMessageMetadata
- Specified by:
getMessageMetadatain interfaceorg.springframework.integration.store.MessageStore
-
getMessageCount
@ManagedAttribute public long getMessageCount()- Specified by:
getMessageCountin interfaceorg.springframework.integration.store.MessageStore
-
removeMessage
- Specified by:
removeMessagein interfaceorg.springframework.integration.store.MessageStore
-
getMessageGroup
- Specified by:
getMessageGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
addMessagesToGroup
public void addMessagesToGroup(Object groupId, org.springframework.messaging.Message<?>... messages) - Specified by:
addMessagesToGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
removeMessagesFromGroup
public void removeMessagesFromGroup(Object groupId, Collection<org.springframework.messaging.Message<?>> messages) - Specified by:
removeMessagesFromGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
removeMessageGroup
- Specified by:
removeMessageGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
iterator
-
pollMessageFromGroup
- Specified by:
pollMessageFromGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
messageGroupSize
- Specified by:
messageGroupSizein interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
setGroupCondition
- Specified by:
setGroupConditionin interfaceorg.springframework.integration.store.MessageGroupStore
-
setLastReleasedSequenceNumberForGroup
- Specified by:
setLastReleasedSequenceNumberForGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
completeGroup
- Specified by:
completeGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
getOneMessageFromGroup
- Specified by:
getOneMessageFromGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
getMessagesForGroup
- Specified by:
getMessagesForGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
streamMessagesForGroup
- Specified by:
streamMessagesForGroupin interfaceorg.springframework.integration.store.MessageGroupStore
-
getMessageCountForAllMessageGroups
@ManagedAttribute public int getMessageCountForAllMessageGroups()- Specified by:
getMessageCountForAllMessageGroupsin interfaceorg.springframework.integration.store.MessageGroupStore- Overrides:
getMessageCountForAllMessageGroupsin classorg.springframework.integration.store.AbstractMessageGroupStore
-
getMessageGroupCount
@ManagedAttribute public int getMessageGroupCount()- Specified by:
getMessageGroupCountin interfaceorg.springframework.integration.store.MessageGroupStore- Overrides:
getMessageGroupCountin classorg.springframework.integration.store.AbstractMessageGroupStore
-