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
The name of the message header that stores a timestamp for the time the message was inserted.
|
static java.lang.String |
SAVED_KEY
The name of the message header that stores a flag to indicate that the message has been saved.
|
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) |
org.springframework.integration.store.MessageGroup |
addMessageToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?> message) |
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() |
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) |
org.springframework.integration.store.MessageGroup |
removeMessageFromGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?> messageToRemove) |
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) |
copy, expireMessageGroups, getGroupMetadata, getMessageBuilderFactory, getOneMessageFromGroup, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setBeanFactory, setExpiryCallbacks, setTimeoutOnIdlegetRemoveBatchSize, setRemoveBatchSizepublic static final java.lang.String SEQUENCE_NAME
public static final java.lang.String SAVED_KEY
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 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.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 org.springframework.integration.store.MessageGroup addMessageToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?> message)
addMessageToGroup in interface org.springframework.integration.store.BasicMessageGroupStorepublic org.springframework.integration.store.MessageGroup removeMessageFromGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?> messageToRemove)
removeMessageFromGroup 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.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