public class MongoDbChannelMessageStore extends AbstractConfigurableMongoDbMessageStore implements PriorityCapableChannelMessageStore
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.
MessageGroupStore.MessageGroupCallback| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_COLLECTION_NAME |
collectionName, logger, mongoDbFactory, SEQUENCE_NAME| Constructor and Description |
|---|
MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory) |
MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory,
MappingMongoConverter mappingMongoConverter) |
MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory,
MappingMongoConverter mappingMongoConverter,
String collectionName) |
MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory,
String collectionName) |
MongoDbChannelMessageStore(MongoTemplate mongoTemplate) |
MongoDbChannelMessageStore(MongoTemplate mongoTemplate,
String collectionName) |
| Modifier and Type | Method and Description |
|---|---|
MessageGroup |
addMessageToGroup(Object groupId,
Message<?> message)
Store a message with an association to a group id.
|
void |
afterPropertiesSet() |
MessageGroup |
getMessageGroup(Object groupId)
Not fully used.
|
boolean |
isPriorityEnabled() |
Message<?> |
pollMessageFromGroup(Object groupId)
Polls Message from this
MessageGroup (in FIFO style if supported by the implementation)
while also removing the polled Message |
void |
setPriorityEnabled(boolean priorityEnabled) |
addMessageDocument, addMessagesToGroup, completeGroup, getApplicationContext, getMappingMongoConverter, getMessage, getMessageBuilderFactory, getMessageMetadata, getMessagesForGroup, getMongoTemplate, getNextId, getOneMessageFromGroup, groupIdQuery, iterator, messageGroupSize, removeMessageGroup, removeMessagesFromGroup, setApplicationContext, setLastReleasedSequenceNumberForGroupcopy, expireMessageGroups, getGroupMetadata, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, setTimeoutOnIdlegetRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmessageGroupSize, removeMessageGroupforEach, spliteratorpublic static final String DEFAULT_COLLECTION_NAME
public MongoDbChannelMessageStore(MongoTemplate mongoTemplate)
public MongoDbChannelMessageStore(MongoTemplate mongoTemplate, String collectionName)
public MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory)
public MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter)
public MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory, String collectionName)
public MongoDbChannelMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter, String collectionName)
public void setPriorityEnabled(boolean priorityEnabled)
public boolean isPriorityEnabled()
isPriorityEnabled in interface PriorityCapableChannelMessageStorepublic void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class AbstractConfigurableMongoDbMessageStorepublic MessageGroup addMessageToGroup(Object groupId, Message<?> message)
BasicMessageGroupStoreaddMessageToGroup in interface BasicMessageGroupStoreaddMessageToGroup in class AbstractMessageGroupStoregroupId - The group id to store the message under.message - A message.public MessageGroup getMessageGroup(Object groupId)
getMessageGroup in interface BasicMessageGroupStoregroupId - The group identifier.public Message<?> pollMessageFromGroup(Object groupId)
BasicMessageGroupStoreMessageGroup (in FIFO style if supported by the implementation)
while also removing the polled MessagepollMessageFromGroup in interface BasicMessageGroupStoregroupId - The group identifier.