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 |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanClassLoader(java.lang.ClassLoader classLoader) |
void |
setLastReleasedSequenceNumberForGroup(java.lang.Object groupId,
int sequenceNumber) |
public 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.BeanClassLoaderAware
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public <T> org.springframework.messaging.Message<T> addMessage(org.springframework.messaging.Message<T> message)
addMessage
in interface org.springframework.integration.store.MessageStore
public 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.MessageStore
public org.springframework.messaging.Message<?> removeMessage(java.util.UUID id)
removeMessage
in interface org.springframework.integration.store.MessageStore
public org.springframework.integration.store.MessageGroup getMessageGroup(java.lang.Object groupId)
getMessageGroup
in interface org.springframework.integration.store.BasicMessageGroupStore
public org.springframework.integration.store.MessageGroup addMessageToGroup(java.lang.Object groupId, org.springframework.messaging.Message<?> message)
addMessageToGroup
in interface org.springframework.integration.store.BasicMessageGroupStore
public org.springframework.integration.store.MessageGroup removeMessageFromGroup(java.lang.Object groupId, org.springframework.messaging.Message<?> messageToRemove)
removeMessageFromGroup
in interface org.springframework.integration.store.MessageGroupStore
public void removeMessageGroup(java.lang.Object groupId)
removeMessageGroup
in interface org.springframework.integration.store.BasicMessageGroupStore
public 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.MessageGroupStore
public org.springframework.messaging.Message<?> pollMessageFromGroup(java.lang.Object groupId)
pollMessageFromGroup
in interface org.springframework.integration.store.BasicMessageGroupStore
public int messageGroupSize(java.lang.Object groupId)
messageGroupSize
in interface org.springframework.integration.store.BasicMessageGroupStore
public void setLastReleasedSequenceNumberForGroup(java.lang.Object groupId, int sequenceNumber)
setLastReleasedSequenceNumberForGroup
in interface org.springframework.integration.store.MessageGroupStore
public 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.MessageGroupStore
getMessageCountForAllMessageGroups
in class org.springframework.integration.store.AbstractMessageGroupStore
@ManagedAttribute public int getMessageGroupCount()
getMessageGroupCount
in interface org.springframework.integration.store.MessageGroupStore
getMessageGroupCount
in class org.springframework.integration.store.AbstractMessageGroupStore