public abstract class AbstractConfigurableMongoDbMessageStore extends AbstractBatchingMessageGroupStore implements BasicMessageGroupStore, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
BasicMessageGroupStore
implementation to provide configuration for common options
for implementations of this class.Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
protected java.lang.String |
collectionName |
static java.lang.String |
CREATED_DATE_KEY
The name of the message header that stores a timestamp for the time the message was inserted.
|
protected org.apache.commons.logging.Log |
logger |
protected org.springframework.data.mongodb.core.convert.MappingMongoConverter |
mappingMongoConverter |
protected MessageBuilderFactory |
messageBuilderFactory |
protected org.springframework.data.mongodb.MongoDbFactory |
mongoDbFactory |
protected org.springframework.data.mongodb.core.MongoTemplate |
mongoTemplate |
static java.lang.String |
SAVED_KEY
The name of the message header that stores a flag to indicate that the message has been saved.
|
static java.lang.String |
SEQUENCE_NAME |
Constructor and Description |
---|
AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter,
java.lang.String collectionName) |
AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory,
java.lang.String collectionName) |
AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate,
java.lang.String collectionName) |
Modifier and Type | Method and Description |
---|---|
protected void |
addMessageDocument(MessageDocument document) |
void |
afterPropertiesSet() |
org.springframework.messaging.Message<?> |
getMessage(java.util.UUID 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 . |
protected static org.springframework.data.mongodb.core.query.Query |
groupIdQuery(java.lang.Object groupId) |
int |
messageGroupSize(java.lang.Object groupId)
Returns the size of this MessageGroup.
|
void |
removeMessageGroup(java.lang.Object groupId)
Remove the message group with this id.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
getRemoveBatchSize, setRemoveBatchSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addMessageToGroup, getMessageGroup, pollMessageFromGroup
public static final java.lang.String SEQUENCE_NAME
public static final java.lang.String SAVED_KEY
public static final java.lang.String CREATED_DATE_KEY
protected final org.apache.commons.logging.Log logger
protected final java.lang.String collectionName
protected final org.springframework.data.mongodb.MongoDbFactory mongoDbFactory
protected org.springframework.data.mongodb.core.MongoTemplate mongoTemplate
protected org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter
protected org.springframework.context.ApplicationContext applicationContext
protected MessageBuilderFactory messageBuilderFactory
public AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, java.lang.String collectionName)
public AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory, java.lang.String collectionName)
public AbstractConfigurableMongoDbMessageStore(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, java.lang.String collectionName)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public org.springframework.messaging.Message<?> getMessage(java.util.UUID id)
public void removeMessageGroup(java.lang.Object groupId)
BasicMessageGroupStore
removeMessageGroup
in interface BasicMessageGroupStore
groupId
- The id of the group to remove.public int messageGroupSize(java.lang.Object groupId)
BasicMessageGroupStore
messageGroupSize
in interface BasicMessageGroupStore
groupId
- 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)
protected static org.springframework.data.mongodb.core.query.Query groupIdQuery(java.lang.Object groupId)