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:
java.lang.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
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_COLLECTION_NAMEThe default conventional collection name.Fields inherited from class org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore
collectionName, logger, mongoDbFactory, SEQUENCE_NAME -
Constructor Summary
Constructors Constructor Description MongoDbChannelMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)MongoDbChannelMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, java.lang.String collectionName)MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory)MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, java.lang.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, java.lang.String collectionName) -
Method Summary
Modifier and Type Method Description org.springframework.integration.store.MessageGroupaddMessageToGroup(java.lang.Object groupId, org.springframework.messaging.Message<?> message)voidafterPropertiesSet()org.springframework.integration.store.MessageGroupgetMessageGroup(java.lang.Object groupId)Not fully used.booleanisPriorityEnabled()org.springframework.messaging.Message<?>pollMessageFromGroup(java.lang.Object groupId)voidsetPriorityEnabled(boolean priorityEnabled)Methods inherited from class org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore
addMessageDocument, addMessagesToGroup, completeGroup, getApplicationContext, getMappingMongoConverter, getMessage, getMessageBuilderFactory, getMessageMetadata, getMessagesForGroup, getMongoTemplate, getNextId, getOneMessageFromGroup, groupIdQuery, iterator, messageGroupSize, removeMessageGroup, removeMessagesFromGroup, setApplicationContext, setLastReleasedSequenceNumberForGroupMethods inherited from class org.springframework.integration.store.AbstractMessageGroupStore
copy, expireMessageGroups, getGroupMetadata, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, 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, wait
-
Field Details
-
DEFAULT_COLLECTION_NAME
public static final java.lang.String DEFAULT_COLLECTION_NAMEThe default conventional collection name.- See Also:
- Constant Field Values
-
-
Constructor Details
-
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate) -
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, java.lang.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, java.lang.String collectionName) -
MongoDbChannelMessageStore
public MongoDbChannelMessageStore(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, java.lang.String collectionName)
-
-
Method Details
-
setPriorityEnabled
public void setPriorityEnabled(boolean priorityEnabled) -
isPriorityEnabled
public boolean isPriorityEnabled()- Specified by:
isPriorityEnabledin interfaceorg.springframework.integration.store.PriorityCapableChannelMessageStore
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classAbstractConfigurableMongoDbMessageStore
-
addMessageToGroup
public org.springframework.integration.store.MessageGroup addMessageToGroup(java.lang.Object groupId, org.springframework.messaging.Message<?> message)- Specified by:
addMessageToGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore- Overrides:
addMessageToGroupin classorg.springframework.integration.store.AbstractMessageGroupStore
-
getMessageGroup
public org.springframework.integration.store.MessageGroup getMessageGroup(java.lang.Object groupId)Not fully used. Only wraps the provided group id.- Specified by:
getMessageGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-
pollMessageFromGroup
public org.springframework.messaging.Message<?> pollMessageFromGroup(java.lang.Object groupId)- Specified by:
pollMessageFromGroupin interfaceorg.springframework.integration.store.BasicMessageGroupStore
-