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
MessageStore and MessageGroupStore
strategies that relies upon MongoDB for persistence.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CREATED_DATE_KEY
Deprecated.
since 5.0. This constant isn't used any more.
|
static java.lang.String |
SAVED_KEY
Deprecated.
since 5.0. This constant isn't used any more.
|
static java.lang.String |
SEQUENCE_NAME |
| Constructor and Description |
|---|
MongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory)
Create a MongoDbMessageStore using the provided
MongoDbFactory.and the default collection name. |
MongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
java.lang.String collectionName)
Create a MongoDbMessageStore using the provided
MongoDbFactory and collection name. |
| Modifier and Type | Method and Description |
|---|---|
<T> org.springframework.messaging.Message<T> |
addMessage(org.springframework.messaging.Message<T> message) |
void |
addMessagesToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?>... messages) |
void |
addWhiteListPatterns(java.lang.String... patterns)
Add patterns for packages/classes that are allowed to be deserialized.
|
void |
afterPropertiesSet() |
void |
completeGroup(java.lang.Object groupId) |
org.springframework.messaging.Message<?> |
getMessage(java.util.UUID id) |
long |
getMessageCount() |
int |
getMessageCountForAllMessageGroups() |
org.springframework.integration.store.MessageGroup |
getMessageGroup(java.lang.Object groupId) |
int |
getMessageGroupCount() |
org.springframework.integration.store.MessageMetadata |
getMessageMetadata(java.util.UUID id) |
java.util.Collection<org.springframework.messaging.Message<?>> |
getMessagesForGroup(java.lang.Object groupId) |
org.springframework.messaging.Message<?> |
getOneMessageFromGroup(java.lang.Object groupId) |
java.util.Iterator<org.springframework.integration.store.MessageGroup> |
iterator() |
int |
messageGroupSize(java.lang.Object groupId) |
org.springframework.messaging.Message<?> |
pollMessageFromGroup(java.lang.Object groupId) |
org.springframework.messaging.Message<?> |
removeMessage(java.util.UUID id) |
void |
removeMessageGroup(java.lang.Object groupId) |
void |
removeMessagesFromGroup(java.lang.Object groupId,
java.util.Collection<org.springframework.messaging.Message<?>> messages) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanClassLoader(java.lang.ClassLoader classLoader) |
void |
setLastReleasedSequenceNumberForGroup(java.lang.Object groupId,
int sequenceNumber) |
addMessageToGroup, copy, expireMessageGroups, getGroupMetadata, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, setTimeoutOnIdlegetRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSizepublic static final java.lang.String SEQUENCE_NAME
@Deprecated public static final java.lang.String SAVED_KEY
@Deprecated public static final java.lang.String CREATED_DATE_KEY
public MongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory)
MongoDbFactory.and the default collection name.mongoDbFactory - The mongodb factory.public MongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
java.lang.String collectionName)
MongoDbFactory and collection name.mongoDbFactory - The mongodb factory.collectionName - The collection name.public void setBeanClassLoader(java.lang.ClassLoader classLoader)
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAwarepublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void addWhiteListPatterns(java.lang.String... patterns)
com.foo.*, *.MyClass.patterns - the patterns.public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic <T> org.springframework.messaging.Message<T> addMessage(org.springframework.messaging.Message<T> message)
addMessage in interface org.springframework.integration.store.MessageStorepublic org.springframework.messaging.Message<?> getMessage(java.util.UUID id)
getMessage in interface org.springframework.integration.store.MessageStorepublic org.springframework.integration.store.MessageMetadata getMessageMetadata(java.util.UUID id)
getMessageMetadata in interface org.springframework.integration.store.MessageStore@ManagedAttribute public long getMessageCount()
getMessageCount in interface org.springframework.integration.store.MessageStorepublic org.springframework.messaging.Message<?> removeMessage(java.util.UUID id)
removeMessage in interface org.springframework.integration.store.MessageStorepublic org.springframework.integration.store.MessageGroup getMessageGroup(java.lang.Object groupId)
getMessageGroup in interface org.springframework.integration.store.BasicMessageGroupStorepublic void addMessagesToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?>... messages)
addMessagesToGroup in interface org.springframework.integration.store.MessageGroupStorepublic void removeMessagesFromGroup(java.lang.Object groupId,
java.util.Collection<org.springframework.messaging.Message<?>> messages)
removeMessagesFromGroup in interface org.springframework.integration.store.MessageGroupStorepublic void removeMessageGroup(java.lang.Object groupId)
removeMessageGroup in interface org.springframework.integration.store.BasicMessageGroupStorepublic java.util.Iterator<org.springframework.integration.store.MessageGroup> iterator()
iterator in interface java.lang.Iterable<org.springframework.integration.store.MessageGroup>iterator in interface org.springframework.integration.store.MessageGroupStorepublic org.springframework.messaging.Message<?> pollMessageFromGroup(java.lang.Object groupId)
pollMessageFromGroup in interface org.springframework.integration.store.BasicMessageGroupStorepublic int messageGroupSize(java.lang.Object groupId)
messageGroupSize in interface org.springframework.integration.store.BasicMessageGroupStorepublic void setLastReleasedSequenceNumberForGroup(java.lang.Object groupId,
int sequenceNumber)
setLastReleasedSequenceNumberForGroup in interface org.springframework.integration.store.MessageGroupStorepublic void completeGroup(java.lang.Object groupId)
completeGroup in interface org.springframework.integration.store.MessageGroupStorepublic org.springframework.messaging.Message<?> getOneMessageFromGroup(java.lang.Object groupId)
getOneMessageFromGroup in interface org.springframework.integration.store.MessageGroupStorepublic java.util.Collection<org.springframework.messaging.Message<?>> getMessagesForGroup(java.lang.Object groupId)
getMessagesForGroup in interface org.springframework.integration.store.MessageGroupStore@ManagedAttribute public int getMessageCountForAllMessageGroups()
getMessageCountForAllMessageGroups in interface org.springframework.integration.store.MessageGroupStoregetMessageCountForAllMessageGroups in class org.springframework.integration.store.AbstractMessageGroupStore@ManagedAttribute public int getMessageGroupCount()
getMessageGroupCount in interface org.springframework.integration.store.MessageGroupStoregetMessageGroupCount in class org.springframework.integration.store.AbstractMessageGroupStore