public class MongoDbStoringMessageHandler extends AbstractMessageHandler
MessageHandler which writes Message payload into a MongoDb collection
identified by evaluation of the collectionNameExpression.loggerHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
MongoDbStoringMessageHandler(MongoDbFactory mongoDbFactory)
Will construct this instance using provided
MongoDbFactory |
MongoDbStoringMessageHandler(MongoOperations mongoTemplate)
Will construct this instance using fully created and initialized instance of
provided
MongoOperations |
| Modifier and Type | Method and Description |
|---|---|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected void |
handleMessageInternal(Message<?> message) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setCollectionNameExpression(Expression collectionNameExpression)
Sets the SpEL
Expression that should resolve to a collection name
used by MongoOperations to store data |
void |
setMongoConverter(MongoConverter mongoConverter)
Allows you to provide custom
MongoConverter used to assist in serialization
of data written to MongoDb. |
getOrder, handleMessage, setOrder, setShouldTrackafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic MongoDbStoringMessageHandler(MongoDbFactory mongoDbFactory)
MongoDbFactorymongoDbFactory - The mongodb factory.public MongoDbStoringMessageHandler(MongoOperations mongoTemplate)
MongoOperationsmongoTemplate - The MongoOperations implementation.public void setMongoConverter(MongoConverter mongoConverter)
MongoConverter used to assist in serialization
of data written to MongoDb. Only allowed if this instance was constructed with a
MongoDbFactory.mongoConverter - The mongo converter.public void setCollectionNameExpression(Expression collectionNameExpression)
Expression that should resolve to a collection name
used by MongoOperations to store datacollectionNameExpression - The collection name expression.public String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected void onInit()
throws Exception
IntegrationObjectSupportonInit in class IntegrationObjectSupportException - Any exception.protected void handleMessageInternal(Message<?> message) throws Exception
handleMessageInternal in class AbstractMessageHandlerException