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
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 ClassesNested 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, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionR2dbcMessageHandler(org.springframework.data.r2dbc.core.R2dbcEntityOperations r2dbcEntityOperations) Construct this instance using a fully created and initialized instance of providedR2dbcEntityOperations. -
Method Summary
Modifier and TypeMethodDescriptionSubclasses may implement this method to provide component type information.protected reactor.core.publisher.Mono<Void>handleMessageInternal(Message<?> message) protected voidonInit()Subclasses may implement this for initialization logic.voidsetCriteriaExpression(Expression criteriaExpression) Set a SpEL expression to evaluate aCriteriafor query to execute.voidSet aR2dbcMessageHandler.Typefor query to execute.voidsetQueryTypeExpression(Expression queryTypeExpression) Set a SpEL expression to evaluate aR2dbcMessageHandler.Typefor query to execute.voidsetTableName(String tableName) Specify a table in the target database to execute the query.voidsetTableNameExpression(Expression tableNameExpression) Set a SpEL expression to evaluate a table name at runtime against request message.voidsetValuesExpression(Expression valuesExpression) Set a SpEL expression to evaluate aMapfor name-value pairs to bind as parameters into a query.Methods inherited from class org.springframework.integration.handler.AbstractReactiveMessageHandler
handleMessageMethods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods 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.Typefor query to execute.- Parameters:
type- theR2dbcMessageHandler.Typeto use.
-
setQueryTypeExpression
Set a SpEL expression to evaluate aR2dbcMessageHandler.Typefor 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 aMapfor name-value pairs to bind as parameters into a query.- Parameters:
valuesExpression- the expression to use.
-
setCriteriaExpression
Set a SpEL expression to evaluate aCriteriafor query to execute.- Parameters:
criteriaExpression- the expression to use.
-
getComponentType
Description copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
getComponentTypein interfaceNamedComponent- Overrides:
getComponentTypein classMessageHandlerSupport
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
onInitin classIntegrationObjectSupport
-
handleMessageInternal
- Specified by:
handleMessageInternalin classAbstractReactiveMessageHandler
-