public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDbMessageStore implements org.springframework.integration.store.MessageStore, org.springframework.integration.store.MessageGroupStore, java.lang.Iterable<org.springframework.integration.store.MessageGroup>
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
interfaceModifier 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) |
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() |
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) |
org.springframework.integration.store.MessageGroup |
removeMessageFromGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?> messageToRemove) |
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, getNextId, groupIdQuery, messageGroupSize, removeMessageGroup, setApplicationContext
public 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)
.expiryCallbacks
- the expiry callbacks to addpublic boolean isTimeoutOnIdle()
public 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'.timeoutOnIdle
- The boolean.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<?> removeMessage(java.util.UUID id)
removeMessage
in interface org.springframework.integration.store.MessageStore
public long getMessageCount()
getMessageCount
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 org.springframework.messaging.Message<?> pollMessageFromGroup(java.lang.Object groupId)
pollMessageFromGroup
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
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 void registerMessageGroupExpiryCallback(org.springframework.integration.store.MessageGroupStore.MessageGroupCallback callback)
registerMessageGroupExpiryCallback
in interface org.springframework.integration.store.MessageGroupStore
public int expireMessageGroups(long timeout)
expireMessageGroups
in interface org.springframework.integration.store.MessageGroupStore
@ManagedAttribute public int getMessageCountForAllMessageGroups()
getMessageCountForAllMessageGroups
in interface org.springframework.integration.store.MessageGroupStore
@ManagedAttribute public int getMessageGroupCount()
getMessageGroupCount
in interface org.springframework.integration.store.MessageGroupStore
public org.springframework.integration.store.MessageGroupMetadata getGroupMetadata(java.lang.Object groupId)
getGroupMetadata
in interface org.springframework.integration.store.MessageGroupStore
public org.springframework.messaging.Message<?> getOneMessageFromGroup(java.lang.Object groupId)
getOneMessageFromGroup
in interface org.springframework.integration.store.MessageGroupStore