public class ConfigurableMongoDbMessageStore
extends org.springframework.integration.store.AbstractMessageGroupStore
implements org.springframework.integration.store.MessageStore, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
MessageStore and MessageGroupStore which allows the user to
configure the instance of MongoTemplate. The mechanism of storing the messages/group of messages
in the store is and is different from MongoDbMessageStore. Since the store uses serialization of the
messages by default, all the headers, and the payload of the Message must implement Serializable
interface| 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 |
DEFAULT_COLLECTION_NAME |
static java.lang.String |
SAVED_KEY
The name of the message header that stores a flag to indicate that the message has been saved.
|
| Constructor and Description |
|---|
ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory) |
ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter) |
ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter,
java.lang.String collectionName) |
ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
java.lang.String collectionName) |
ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate) |
ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate,
java.lang.String collectionName) |
| Modifier and Type | Method and Description |
|---|---|
<T> org.springframework.integration.Message<T> |
addMessage(org.springframework.integration.Message<T> message) |
org.springframework.integration.store.MessageGroup |
addMessageToGroup(java.lang.Object groupId,
org.springframework.integration.Message<?> message) |
void |
afterPropertiesSet() |
void |
completeGroup(java.lang.Object groupId) |
org.springframework.integration.Message<?> |
getMessage(java.util.UUID id) |
long |
getMessageCount() |
org.springframework.integration.store.MessageGroup |
getMessageGroup(java.lang.Object groupId) |
java.util.Iterator<org.springframework.integration.store.MessageGroup> |
iterator() |
int |
messageGroupSize(java.lang.Object groupId) |
org.springframework.integration.Message<?> |
pollMessageFromGroup(java.lang.Object groupId) |
org.springframework.integration.Message<?> |
removeMessage(java.util.UUID id) |
org.springframework.integration.store.MessageGroup |
removeMessageFromGroup(java.lang.Object groupId,
org.springframework.integration.Message<?> messageToRemove) |
void |
removeMessageGroup(java.lang.Object groupId) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setLastReleasedSequenceNumberForGroup(java.lang.Object groupId,
int sequenceNumber) |
public static final java.lang.String DEFAULT_COLLECTION_NAME
public static final java.lang.String SAVED_KEY
public static final java.lang.String CREATED_DATE_KEY
public ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)
public ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate,
java.lang.String collectionName)
public ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory)
public ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter)
public ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
java.lang.String collectionName)
public ConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter,
java.lang.String collectionName)
public 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 org.springframework.integration.Message<?> getMessage(java.util.UUID id)
getMessage in interface org.springframework.integration.store.MessageStorepublic <T> org.springframework.integration.Message<T> addMessage(org.springframework.integration.Message<T> message)
addMessage in interface org.springframework.integration.store.MessageStorepublic org.springframework.integration.Message<?> removeMessage(java.util.UUID id)
removeMessage in interface org.springframework.integration.store.MessageStorepublic long getMessageCount()
getMessageCount in interface org.springframework.integration.store.MessageStorepublic int messageGroupSize(java.lang.Object groupId)
messageGroupSize in interface org.springframework.integration.store.MessageGroupStorepublic org.springframework.integration.store.MessageGroup getMessageGroup(java.lang.Object groupId)
getMessageGroup in interface org.springframework.integration.store.MessageGroupStorepublic org.springframework.integration.store.MessageGroup addMessageToGroup(java.lang.Object groupId,
org.springframework.integration.Message<?> message)
addMessageToGroup in interface org.springframework.integration.store.MessageGroupStorepublic org.springframework.integration.store.MessageGroup removeMessageFromGroup(java.lang.Object groupId,
org.springframework.integration.Message<?> messageToRemove)
removeMessageFromGroup in interface org.springframework.integration.store.MessageGroupStorepublic void removeMessageGroup(java.lang.Object groupId)
removeMessageGroup in interface org.springframework.integration.store.MessageGroupStorepublic 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.integration.Message<?> pollMessageFromGroup(java.lang.Object groupId)
pollMessageFromGroup in interface org.springframework.integration.store.MessageGroupStorepublic 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