public class MongoDbStoringMessageHandler extends AbstractMessageHandler
MessageHandler which writes Message payload into a MongoDb collection
identified by evaluation of the collectionNameExpression.logger| Constructor and Description |
|---|
MongoDbStoringMessageHandler(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory)
Will construct this instance using provided
MongoDbFactory |
MongoDbStoringMessageHandler(org.springframework.data.mongodb.core.MongoOperations mongoTemplate)
Will construct this instance using fully created and initialized instance of
provided
MongoOperations |
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleMessageInternal(org.springframework.messaging.Message<?> message) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setCollectionNameExpression(org.springframework.expression.Expression collectionNameExpression)
Sets the SpEL
Expression that should resolve to a collection name
used by MongoOperations to store data |
void |
setMongoConverter(org.springframework.data.mongodb.core.convert.MongoConverter mongoConverter)
Allows you to provide custom
MongoConverter used to assist in serialization
of data written to MongoDb. |
getComponentType, getOrder, handleMessage, setOrder, setShouldTrackafterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic MongoDbStoringMessageHandler(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory)
MongoDbFactorymongoDbFactory - public MongoDbStoringMessageHandler(org.springframework.data.mongodb.core.MongoOperations mongoTemplate)
MongoOperationsmongoTemplate - public void setMongoConverter(org.springframework.data.mongodb.core.convert.MongoConverter mongoConverter)
MongoConverter used to assist in serialization
of data written to MongoDb. Only allowed if this instance was constructed with a
MongoDbFactory.mongoConverter - public void setCollectionNameExpression(org.springframework.expression.Expression collectionNameExpression)
Expression that should resolve to a collection name
used by MongoOperations to store datacollectionNameExpression - protected void onInit()
throws java.lang.Exception
IntegrationObjectSupportonInit in class IntegrationObjectSupportjava.lang.Exceptionprotected void handleMessageInternal(org.springframework.messaging.Message<?> message)
throws java.lang.Exception
handleMessageInternal in class AbstractMessageHandlerjava.lang.Exception