Class R2dbcMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractReactiveMessageHandler
org.springframework.integration.r2dbc.outbound.R2dbcMessageHandler
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,ApplicationContextAware
,Ordered
,ExpressionCapable
,Orderable
,IntegrationPattern
,NamedComponent
,IntegrationManagement
,TrackableComponent
,ReactiveMessageHandler
public class R2dbcMessageHandler extends AbstractReactiveMessageHandler
Implementation of
ReactiveMessageHandler
which writes
Message payload into a Relational Database, using reactive r2dbc support.- Since:
- 5.4
- Author:
- Rohan Mukesh, Artem Bilan
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
R2dbcMessageHandler.Type
/** The mode for theR2dbcMessageHandler
.Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides
-
Field Summary
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors Constructor Description R2dbcMessageHandler(org.springframework.data.r2dbc.core.R2dbcEntityOperations r2dbcEntityOperations)
Construct this instance using a fully created and initialized instance of providedR2dbcEntityOperations
-
Method Summary
Modifier and Type Method Description String
getComponentType()
Subclasses may implement this method to provide component type information.protected reactor.core.publisher.Mono<Void>
handleMessageInternal(Message<?> message)
protected void
onInit()
Subclasses may implement this for initialization logic.void
setCriteriaExpression(Expression criteriaExpression)
Set a SpEL expression to evaluate aCriteria
for query to execute.void
setQueryType(R2dbcMessageHandler.Type type)
Set aR2dbcMessageHandler.Type
for query to execute.void
setQueryTypeExpression(Expression queryTypeExpression)
Set a SpEL expression to evaluate aR2dbcMessageHandler.Type
for query to execute.void
setTableName(String tableName)
Specify a table in the target database to execute the query.void
setTableNameExpression(Expression tableNameExpression)
Set a SpEL expression to evaluate a table name at runtime against request message.void
setValuesExpression(Expression valuesExpression)
Set a SpEL expression to evaluate aMap
for name-value pairs to bind as parameters into a query.Methods inherited from class org.springframework.integration.handler.AbstractReactiveMessageHandler
handleMessage
Methods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
R2dbcMessageHandler
public R2dbcMessageHandler(org.springframework.data.r2dbc.core.R2dbcEntityOperations r2dbcEntityOperations)Construct this instance using a fully created and initialized instance of providedR2dbcEntityOperations
- Parameters:
r2dbcEntityOperations
- The R2dbcEntityOperations implementation.
-
-
Method Details
-
setQueryType
Set aR2dbcMessageHandler.Type
for query to execute.- Parameters:
type
- theR2dbcMessageHandler.Type
to use.
-
setQueryTypeExpression
Set a SpEL expression to evaluate aR2dbcMessageHandler.Type
for query to execute.- Parameters:
queryTypeExpression
- the expression to use.
-
setTableName
Specify a table in the target database to execute the query.- Parameters:
tableName
- the name of the table to use.
-
setTableNameExpression
Set a SpEL expression to evaluate a table name at runtime against request message.- Parameters:
tableNameExpression
- the expression to use.
-
setValuesExpression
Set a SpEL expression to evaluate aMap
for name-value pairs to bind as parameters into a query.- Parameters:
valuesExpression
- the expression to use.
-
setCriteriaExpression
Set a SpEL expression to evaluate aCriteria
for query to execute.- Parameters:
criteriaExpression
- the expression to use.
-
getComponentType
Description copied from class:IntegrationObjectSupport
Subclasses may implement this method to provide component type information.- Specified by:
getComponentType
in interfaceNamedComponent
- Overrides:
getComponentType
in classMessageHandlerSupport
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupport
Subclasses may implement this for initialization logic.- Overrides:
onInit
in classIntegrationObjectSupport
-
handleMessageInternal
- Specified by:
handleMessageInternal
in classAbstractReactiveMessageHandler
-