public abstract class AbstractConfigurableMongoDbMessageStore extends AbstractMessageGroupStore implements BasicMessageGroupStore, InitializingBean, ApplicationContextAware
BasicMessageGroupStore implementation to provide configuration for common options
for implementations of this class.MessageGroupStore.MessageGroupCallback| Modifier and Type | Field and Description |
|---|---|
protected ApplicationContext |
applicationContext |
protected String |
collectionName |
static String |
CREATED_DATE_KEY
Deprecated.
since 5.0. This constant isn't used any more.
|
protected Log |
logger |
protected MappingMongoConverter |
mappingMongoConverter |
protected MessageBuilderFactory |
messageBuilderFactory |
protected MongoDbFactory |
mongoDbFactory |
protected MongoTemplate |
mongoTemplate |
static String |
SAVED_KEY
Deprecated.
since 5.0. This constant isn't used any more.
|
static String |
SEQUENCE_NAME |
| Constructor and Description |
|---|
AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory,
MappingMongoConverter mappingMongoConverter,
String collectionName) |
AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory,
String collectionName) |
AbstractConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate,
String collectionName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addMessageDocument(MessageDocument document) |
void |
addMessagesToGroup(Object groupId,
Message<?>... messages)
Store messages with an association to a group id.
|
void |
afterPropertiesSet() |
void |
completeGroup(Object groupId)
Completes this MessageGroup.
|
Message<?> |
getMessage(UUID id) |
MessageMetadata |
getMessageMetadata(UUID id) |
Collection<Message<?>> |
getMessagesForGroup(Object groupId)
Retrieve messages for the provided group id.
|
protected int |
getNextId()
Perform MongoDB
INC operation for the document, which contains the MessageDocument
sequence, and return the new incremented value for the new MessageDocument. |
Message<?> |
getOneMessageFromGroup(Object groupId)
Return the one
Message from MessageGroup. |
protected static Query |
groupIdQuery(Object groupId) |
Iterator<MessageGroup> |
iterator() |
int |
messageGroupSize(Object groupId)
Returns the size of this MessageGroup.
|
void |
removeMessageGroup(Object groupId)
Remove the message group with this id.
|
void |
removeMessagesFromGroup(Object key,
Collection<Message<?>> messages)
Persist the deletion of messages from the group.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setLastReleasedSequenceNumberForGroup(Object groupId,
int sequenceNumber)
Allows you to set the sequence number of the last released Message.
|
addMessageToGroup, copy, expireMessageGroups, getGroupMetadata, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, setTimeoutOnIdlegetRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddMessageToGroup, getMessageGroup, pollMessageFromGroupforEach, spliteratorpublic static final String SEQUENCE_NAME
@Deprecated public static final String SAVED_KEY
@Deprecated public static final String CREATED_DATE_KEY
protected final Log logger
protected final String collectionName
protected final MongoDbFactory mongoDbFactory
protected MongoTemplate mongoTemplate
protected MappingMongoConverter mappingMongoConverter
protected ApplicationContext applicationContext
protected MessageBuilderFactory messageBuilderFactory
public AbstractConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate, String collectionName)
public AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory, String collectionName)
public AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter, String collectionName)
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic MessageMetadata getMessageMetadata(UUID id)
public void removeMessageGroup(Object groupId)
BasicMessageGroupStoreremoveMessageGroup in interface BasicMessageGroupStoregroupId - The id of the group to remove.public int messageGroupSize(Object groupId)
BasicMessageGroupStoremessageGroupSize in interface BasicMessageGroupStoregroupId - The group identifier.protected int getNextId()
INC operation for the document, which contains the MessageDocument
sequence, and return the new incremented value for the new MessageDocument.
The SEQUENCE_NAME document is created on demand.protected void addMessageDocument(MessageDocument document)
public void removeMessagesFromGroup(Object key, Collection<Message<?>> messages)
MessageGroupStoreremoveMessagesFromGroup in interface MessageGroupStorekey - The groupId for the group containing the message(s).messages - The messages to be removed.public void setLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber)
MessageGroupStoresetLastReleasedSequenceNumberForGroup in interface MessageGroupStoregroupId - The group identifier.sequenceNumber - The sequence number.public Iterator<MessageGroup> iterator()
iterator in interface Iterable<MessageGroup>iterator in interface MessageGroupStoreMessageGroups.public void completeGroup(Object groupId)
MessageGroupStorecompleteGroup in interface MessageGroupStoregroupId - The group identifier.public Message<?> getOneMessageFromGroup(Object groupId)
MessageGroupStoreMessage from MessageGroup.getOneMessageFromGroup in interface MessageGroupStoregroupId - The group identifier.Message.public void addMessagesToGroup(Object groupId, Message<?>... messages)
MessageGroupStoreaddMessagesToGroup in interface MessageGroupStoregroupId - The group id to store messages under.messages - The messages to add.public Collection<Message<?>> getMessagesForGroup(Object groupId)
MessageGroupStoregetMessagesForGroup in interface MessageGroupStoregroupId - The group id to retrieve messages for.