public class MongoDbStoringMessageHandler extends AbstractMessageHandler
MessageHandler which writes Message payload into a MongoDb collection
identified by evaluation of the collectionNameExpression.EXPRESSION_PARSER, 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. |
configureMetrics, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, 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 AbstractMessageHandlerException - Any exception.protected void handleMessageInternal(Message<?> message) throws Exception
handleMessageInternal in class AbstractMessageHandlerException