public abstract class AbstractConfigurableMongoDbMessageStore extends Object implements BasicMessageGroupStore, InitializingBean, ApplicationContextAware
BasicMessageGroupStore
implementation to provide configuration for common options
for implementations of this class.Modifier and Type | Field and Description |
---|---|
protected ApplicationContext |
applicationContext |
protected String |
collectionName |
static 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 MappingMongoConverter |
mappingMongoConverter |
protected MessageBuilderFactory |
messageBuilderFactory |
protected MongoDbFactory |
mongoDbFactory |
protected MongoTemplate |
mongoTemplate |
static String |
SAVED_KEY
The name of the message header that stores a flag to indicate that the message has been saved.
|
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 |
afterPropertiesSet() |
Message<?> |
getMessage(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 Query |
groupIdQuery(Object groupId) |
int |
messageGroupSize(Object groupId)
Returns the size of this MessageGroup.
|
void |
removeMessageGroup(Object groupId)
Remove the message group with this id.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addMessageToGroup, getMessageGroup, pollMessageFromGroup
public static final String SEQUENCE_NAME
public static final String SAVED_KEY
public static final String CREATED_DATE_KEY
protected final org.apache.commons.logging.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 ApplicationContextAware
BeansException
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public void removeMessageGroup(Object groupId)
BasicMessageGroupStore
removeMessageGroup
in interface BasicMessageGroupStore
groupId
- The id of the group to remove.public int messageGroupSize(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)