Class MongoDbChannelMessageStore
java.lang.Object
org.springframework.integration.store.AbstractBatchingMessageGroupStore
org.springframework.integration.store.AbstractMessageGroupStore
org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore
org.springframework.integration.mongodb.store.MongoDbChannelMessageStore
- All Implemented Interfaces:
Iterable<org.springframework.integration.store.MessageGroup>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.integration.store.BasicMessageGroupStore,org.springframework.integration.store.ChannelMessageStore,org.springframework.integration.store.MessageGroupStore,org.springframework.integration.store.PriorityCapableChannelMessageStore
public class MongoDbChannelMessageStore
extends AbstractConfigurableMongoDbMessageStore
implements org.springframework.integration.store.PriorityCapableChannelMessageStore
MongoDB
PriorityCapableChannelMessageStore implementation.
This message store shall be used for message channels only.
Provide the priorityEnabled option to allow to poll messages via priority manner.
As a priority document field the IntegrationMessageHeaderAccessor.PRIORITY
message header is used.
The same collection can be used for org.springframework.integration.channel.QueueChannels and
org.springframework.integration.channel.PriorityChannels, but the different instances of
MongoDbChannelMessageStore should be used for those cases, and the last one with
priorityEnabled = true option.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.store.MessageGroupStore
org.springframework.integration.store.MessageGroupStore.MessageGroupCallback -
Field Summary
FieldsFields inherited from class org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore
collectionName, logger, mongoDbFactory, SEQUENCE_NAMEFields inherited from class org.springframework.integration.store.AbstractMessageGroupStore
GROUP_ID_MUST_NOT_BE_NULL, INTERRUPTED_WHILE_OBTAINING_LOCK -
Constructor Summary
ConstructorsConstructorDescriptionMongoDbChannelMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate) MongoDbChannelMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, String collectionName) MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory) MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, String collectionName) MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter) MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, String collectionName) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.integration.store.MessageGroupaddMessageToGroup(Object groupId, org.springframework.messaging.Message<?> message) protected voidprotected org.springframework.messaging.Message<?>doPollMessageFromGroup(Object groupId) org.springframework.integration.store.MessageGroupgetMessageGroup(Object groupId) Not fully used.booleanvoidsetPriorityEnabled(boolean priorityEnabled) Methods inherited from class org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore
addMessageDocument, afterPropertiesSet, doAddMessagesToGroup, doCompleteGroup, doRemoveMessageGroup, doRemoveMessagesFromGroup, doSetGroupCondition, doSetLastReleasedSequenceNumberForGroup, getApplicationContext, getMappingMongoConverter, getMessage, getMessageBuilderFactory, getMessageMetadata, getMessagesForGroup, getMongoTemplate, getNextId, getOneMessageFromGroup, groupIdQuery, iterator, messageGroupSize, setApplicationContext, setCreateIndexesMethods inherited from class org.springframework.integration.store.AbstractMessageGroupStore
addMessagesToGroup, completeGroup, copy, doRemoveMessageFromGroupById, executeLocked, executeLocked, expireMessageGroups, getGroupMetadata, getLockRegistry, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, pollMessageFromGroup, registerMessageGroupExpiryCallback, removeMessageFromGroupById, removeMessageGroup, removeMessagesFromGroup, removeMessagesFromGroup, setExpiryCallbacks, setGroupCondition, setLastReleasedSequenceNumberForGroup, setLazyLoadMessageGroups, setLockRegistry, setTimeoutOnIdleMethods inherited from class org.springframework.integration.store.AbstractBatchingMessageGroupStore
getRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.store.BasicMessageGroupStore
messageGroupSize, pollMessageFromGroup, removeMessageGroupMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.springframework.integration.store.MessageGroupStore
getMessageFromGroup, streamMessagesForGroup
-
Field Details
-
DEFAULT_COLLECTION_NAME
The default conventional collection name.- See Also:
-
-
Constructor Details
-
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate) -
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, String collectionName) -
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory) -
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter) -
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, String collectionName) -
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, String collectionName)
-
-
Method Details
-
setPriorityEnabled
public void setPriorityEnabled(boolean priorityEnabled) -
isPriorityEnabled
public boolean isPriorityEnabled()- Specified by:
isPriorityEnabledin interfaceorg.springframework.integration.store.PriorityCapableChannelMessageStore
-
createIndexes
protected void createIndexes()- Overrides:
createIndexesin classAbstractConfigurableMongoDbMessageStore
-
addMessageToGroup
public org.springframework.integration.store.MessageGroup addMessageToGroup(Object groupId, org.springframework.messaging.Message<?> message) - Specified by:
addMessageToGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore- Overrides:
addMessageToGroupin classorg.springframework.integration.store.AbstractMessageGroupStore
-
getMessageGroup
Not fully used. Only wraps the provided group id.- Specified by:
getMessageGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
doPollMessageFromGroup
- Specified by:
doPollMessageFromGroupin classorg.springframework.integration.store.AbstractMessageGroupStore
-