public class MongoDbStoringMessageHandler extends AbstractMessageHandler
MessageHandler
which writes Message payload into a MongoDb collection
identified by evaluation of the collectionNameExpression
.IntegrationManagement.ManagementOverrides
EXPRESSION_PARSER, logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
MongoDbStoringMessageHandler(MongoDatabaseFactory mongoDbFactory)
Will construct this instance using provided
MongoDatabaseFactory |
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. |
handleMessage, onComplete, onError, onNext, onSubscribe
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getThisAs
getBeanName, getComponentName
public MongoDbStoringMessageHandler(MongoDatabaseFactory mongoDbFactory)
MongoDatabaseFactory
mongoDbFactory
- The mongodb factory.public MongoDbStoringMessageHandler(MongoOperations mongoTemplate)
MongoOperations
mongoTemplate
- 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
MongoDatabaseFactory
.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()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class MessageHandlerSupport
protected void onInit()
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
protected void handleMessageInternal(Message<?> message)
handleMessageInternal
in class AbstractMessageHandler