public class MongoDbStoringMessageHandler extends AbstractMessageHandler
MessageHandler which writes Message payload into a MongoDb collection
identified by evaluation of the collectionNameExpression.IntegrationManagement.ManagementOverridesEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| 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 |
|---|---|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
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. |
configureMetrics, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic MongoDbStoringMessageHandler(org.springframework.data.mongodb.MongoDbFactory mongoDbFactory)
MongoDbFactorymongoDbFactory - The mongodb factory.public MongoDbStoringMessageHandler(org.springframework.data.mongodb.core.MongoOperations mongoTemplate)
MongoOperationsmongoTemplate - The MongoOperations implementation.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 - The mongo converter.public void setCollectionNameExpression(org.springframework.expression.Expression collectionNameExpression)
Expression that should resolve to a collection name
used by MongoOperations to store datacollectionNameExpression - The collection name expression.public java.lang.String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected void onInit()
throws java.lang.Exception
IntegrationObjectSupportonInit in class AbstractMessageHandlerjava.lang.Exception - Any exception.protected void handleMessageInternal(org.springframework.messaging.Message<?> message)
throws java.lang.Exception
handleMessageInternal in class AbstractMessageHandlerjava.lang.Exception