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.QueueChannel
s and
org.springframework.integration.channel.PriorityChannel
s, 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
The default conventional 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, setLastReleasedSequenceNumberForGroup
copy, expireMessageGroups, getGroupMetadata, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, setTimeoutOnIdle
getRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
messageGroupSize, removeMessageGroup
forEach, spliterator
public 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 PriorityCapableChannelMessageStore
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class AbstractConfigurableMongoDbMessageStore
public MessageGroup addMessageToGroup(Object groupId, Message<?> message)
BasicMessageGroupStore
addMessageToGroup
in interface BasicMessageGroupStore
addMessageToGroup
in class AbstractMessageGroupStore
groupId
- The group id to store the message under.message
- A message.public MessageGroup getMessageGroup(Object groupId)
getMessageGroup
in interface BasicMessageGroupStore
groupId
- The group identifier.public Message<?> pollMessageFromGroup(Object groupId)
BasicMessageGroupStore
MessageGroup
(in FIFO style if supported by the implementation)
while also removing the polled Message
pollMessageFromGroup
in interface BasicMessageGroupStore
groupId
- The group identifier.