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 QueueChannel
s and
PriorityChannel
s, but the different instances of
MongoDbChannelMessageStore
should be used for those cases, and the last one with
priorityEnabled = true
option.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_COLLECTION_NAME |
applicationContext, collectionName, CREATED_DATE_KEY, logger, mappingMongoConverter, messageBuilderFactory, mongoDbFactory, mongoTemplate, SAVED_KEY, SEQUENCE_NAME
Constructor and Description |
---|
MongoDbChannelMessageStore(MongoDbFactory mongoDbFactory) |
MongoDbChannelMessageStore(MongoDbFactory mongoDbFactory,
MappingMongoConverter mappingMongoConverter) |
MongoDbChannelMessageStore(MongoDbFactory mongoDbFactory,
MappingMongoConverter mappingMongoConverter,
String collectionName) |
MongoDbChannelMessageStore(MongoDbFactory 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, getMessage, getNextId, groupIdQuery, messageGroupSize, removeMessageGroup, setApplicationContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
messageGroupSize, removeMessageGroup
public static final String DEFAULT_COLLECTION_NAME
public MongoDbChannelMessageStore(MongoTemplate mongoTemplate)
public MongoDbChannelMessageStore(MongoTemplate mongoTemplate, String collectionName)
public MongoDbChannelMessageStore(MongoDbFactory mongoDbFactory)
public MongoDbChannelMessageStore(MongoDbFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter)
public MongoDbChannelMessageStore(MongoDbFactory mongoDbFactory, String collectionName)
public MongoDbChannelMessageStore(MongoDbFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter, String collectionName)
public void setPriorityEnabled(boolean priorityEnabled)
public boolean isPriorityEnabled()
isPriorityEnabled
in interface PriorityCapableChannelMessageStore
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class AbstractConfigurableMongoDbMessageStore
Exception
public MessageGroup addMessageToGroup(Object groupId, Message<?> message)
BasicMessageGroupStore
addMessageToGroup
in interface BasicMessageGroupStore
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.