public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDbMessageStore implements org.springframework.integration.store.MessageStore
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 |
DEFAULT_COLLECTION_NAME |
applicationContext, collectionName, CREATED_DATE_KEY, logger, mappingMongoConverter, messageBuilderFactory, mongoDbFactory, mongoTemplate, SAVED_KEY, SEQUENCE_NAME| 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.messaging.Message<T> |
addMessage(org.springframework.messaging.Message<T> message) |
void |
addMessagesToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?>... messages) |
org.springframework.integration.store.MessageGroup |
addMessageToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?> message) |
void |
completeGroup(java.lang.Object groupId) |
int |
expireMessageGroups(long timeout) |
org.springframework.integration.store.MessageGroupMetadata |
getGroupMetadata(java.lang.Object groupId) |
long |
getMessageCount() |
int |
getMessageCountForAllMessageGroups() |
org.springframework.integration.store.MessageGroup |
getMessageGroup(java.lang.Object groupId) |
int |
getMessageGroupCount() |
java.util.Collection<org.springframework.messaging.Message<?>> |
getMessagesForGroup(java.lang.Object groupId) |
org.springframework.messaging.Message<?> |
getOneMessageFromGroup(java.lang.Object groupId) |
boolean |
isTimeoutOnIdle() |
java.util.Iterator<org.springframework.integration.store.MessageGroup> |
iterator() |
org.springframework.messaging.Message<?> |
pollMessageFromGroup(java.lang.Object groupId) |
void |
registerMessageGroupExpiryCallback(org.springframework.integration.store.MessageGroupStore.MessageGroupCallback callback) |
org.springframework.messaging.Message<?> |
removeMessage(java.util.UUID id) |
void |
removeMessagesFromGroup(java.lang.Object groupId,
java.util.Collection<org.springframework.messaging.Message<?>> messages) |
void |
removeMessagesFromGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?>... messages) |
void |
setExpiryCallbacks(java.util.Collection<org.springframework.integration.store.MessageGroupStore.MessageGroupCallback> expiryCallbacks)
Convenient injection point for expiry callbacks in the message store.
|
void |
setLastReleasedSequenceNumberForGroup(java.lang.Object groupId,
int sequenceNumber) |
void |
setTimeoutOnIdle(boolean timeoutOnIdle)
Allows you to override the rule for the timeout calculation.
|
addMessageDocument, afterPropertiesSet, getMessage, getMessageMetadata, getNextId, groupIdQuery, messageGroupSize, removeMessageGroup, setApplicationContextcopy, getMessageGroupFactory, setLazyLoadMessageGroupsgetRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final java.lang.String DEFAULT_COLLECTION_NAME
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 setExpiryCallbacks(java.util.Collection<org.springframework.integration.store.MessageGroupStore.MessageGroupCallback> expiryCallbacks)
MessageGroupStore.registerMessageGroupExpiryCallback(MessageGroupCallback).setExpiryCallbacks in class org.springframework.integration.store.AbstractMessageGroupStoreexpiryCallbacks - the expiry callbacks to addpublic boolean isTimeoutOnIdle()
isTimeoutOnIdle in class org.springframework.integration.store.AbstractMessageGroupStorepublic void setTimeoutOnIdle(boolean timeoutOnIdle)
MessageGroup was created. If you want the timeout to be based on the time
the MessageGroup was idling (e.g., inactive from the last update) invoke this method with 'true'.
Default is 'false'.setTimeoutOnIdle in class org.springframework.integration.store.AbstractMessageGroupStoretimeoutOnIdle - The boolean.public <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<?> removeMessage(java.util.UUID id)
removeMessage in interface org.springframework.integration.store.MessageStorepublic long getMessageCount()
getMessageCount 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.BasicMessageGroupStoreaddMessageToGroup in class org.springframework.integration.store.AbstractMessageGroupStorepublic void addMessagesToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?>... messages)
addMessagesToGroup in interface org.springframework.integration.store.MessageGroupStoreaddMessagesToGroup in class AbstractConfigurableMongoDbMessageStorepublic void removeMessagesFromGroup(java.lang.Object groupId,
java.util.Collection<org.springframework.messaging.Message<?>> messages)
removeMessagesFromGroup in interface org.springframework.integration.store.MessageGroupStoreremoveMessagesFromGroup in class AbstractConfigurableMongoDbMessageStorepublic void removeMessagesFromGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?>... messages)
removeMessagesFromGroup in interface org.springframework.integration.store.MessageGroupStoreremoveMessagesFromGroup in class org.springframework.integration.store.AbstractMessageGroupStorepublic org.springframework.messaging.Message<?> pollMessageFromGroup(java.lang.Object groupId)
pollMessageFromGroup in interface org.springframework.integration.store.BasicMessageGroupStorepublic void setLastReleasedSequenceNumberForGroup(java.lang.Object groupId,
int sequenceNumber)
setLastReleasedSequenceNumberForGroup in interface org.springframework.integration.store.MessageGroupStoresetLastReleasedSequenceNumberForGroup in class AbstractConfigurableMongoDbMessageStorepublic void completeGroup(java.lang.Object groupId)
completeGroup in interface org.springframework.integration.store.MessageGroupStorecompleteGroup in class AbstractConfigurableMongoDbMessageStorepublic 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.MessageGroupStoreiterator in class AbstractConfigurableMongoDbMessageStorepublic void registerMessageGroupExpiryCallback(org.springframework.integration.store.MessageGroupStore.MessageGroupCallback callback)
registerMessageGroupExpiryCallback in interface org.springframework.integration.store.MessageGroupStoreregisterMessageGroupExpiryCallback in class org.springframework.integration.store.AbstractMessageGroupStore@ManagedOperation public int expireMessageGroups(long timeout)
expireMessageGroups in interface org.springframework.integration.store.MessageGroupStoreexpireMessageGroups in class org.springframework.integration.store.AbstractMessageGroupStore@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.AbstractMessageGroupStorepublic org.springframework.integration.store.MessageGroupMetadata getGroupMetadata(java.lang.Object groupId)
getGroupMetadata in interface org.springframework.integration.store.MessageGroupStoregetGroupMetadata in class org.springframework.integration.store.AbstractMessageGroupStorepublic org.springframework.messaging.Message<?> getOneMessageFromGroup(java.lang.Object groupId)
getOneMessageFromGroup in interface org.springframework.integration.store.MessageGroupStoregetOneMessageFromGroup in class AbstractConfigurableMongoDbMessageStorepublic java.util.Collection<org.springframework.messaging.Message<?>> getMessagesForGroup(java.lang.Object groupId)
getMessagesForGroup in interface org.springframework.integration.store.MessageGroupStoregetMessagesForGroup in class AbstractConfigurableMongoDbMessageStore