Class R2dbcMessageHandler

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ComponentSourceAware, 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
  • Constructor Details

    • R2dbcMessageHandler

      public R2dbcMessageHandler(org.springframework.data.r2dbc.core.R2dbcEntityOperations r2dbcEntityOperations)
      Construct this instance using a fully created and initialized instance of provided R2dbcEntityOperations.
      Parameters:
      r2dbcEntityOperations - The R2dbcEntityOperations implementation.
  • Method Details

    • setQueryType

      public void setQueryType(R2dbcMessageHandler.Type type)
      Set a R2dbcMessageHandler.Type for query to execute.
      Parameters:
      type - the R2dbcMessageHandler.Type to use.
    • setQueryTypeExpression

      public void setQueryTypeExpression(Expression queryTypeExpression)
      Set a SpEL expression to evaluate a R2dbcMessageHandler.Type for query to execute.
      Parameters:
      queryTypeExpression - the expression to use.
    • setTableName

      public void setTableName(String tableName)
      Specify a table in the target database to execute the query.
      Parameters:
      tableName - the name of the table to use.
    • setTableNameExpression

      public void setTableNameExpression(Expression tableNameExpression)
      Set a SpEL expression to evaluate a table name at runtime against request message.
      Parameters:
      tableNameExpression - the expression to use.
    • setValuesExpression

      public void setValuesExpression(Expression valuesExpression)
      Set a SpEL expression to evaluate a Map for name-value pairs to bind as parameters into a query.
      Parameters:
      valuesExpression - the expression to use.
    • setCriteriaExpression

      public void setCriteriaExpression(Expression criteriaExpression)
      Set a SpEL expression to evaluate a Criteria for query to execute.
      Parameters:
      criteriaExpression - the expression to use.
    • getComponentType

      public String getComponentType()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this method to provide component type information.
      Specified by:
      getComponentType in interface NamedComponent
      Overrides:
      getComponentType in class MessageHandlerSupport
    • onInit

      protected void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      Overrides:
      onInit in class IntegrationObjectSupport
    • handleMessageInternal

      protected reactor.core.publisher.Mono<Void> handleMessageInternal(Message<?> message)
      Specified by:
      handleMessageInternal in class AbstractReactiveMessageHandler