Class JdbcOutboundGateway

All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ExpressionCapable, Orderable, MessageProducer, HeaderPropagationAware, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>

public class JdbcOutboundGateway extends AbstractReplyProducingMessageHandler
Since:
2.0
Author:
Dave Syer, Gunnar Hillert, Artem Bilan, Gary Russell
  • Constructor Details

    • JdbcOutboundGateway

      public JdbcOutboundGateway(DataSource dataSource, String updateQuery)
    • JdbcOutboundGateway

      public JdbcOutboundGateway(DataSource dataSource, String updateQuery, String selectQuery)
    • JdbcOutboundGateway

      public JdbcOutboundGateway(JdbcOperations jdbcOperations, String updateQuery)
    • JdbcOutboundGateway

      public JdbcOutboundGateway(JdbcOperations jdbcOperations, String updateQuery, String selectQuery)
  • Method Details

    • setMaxRows

      public void setMaxRows(Integer maxRows)
      The maximum number of rows to query. The value is set on the underlying JdbcPollingChannelAdapter. Also used to check before producing reply: if result has only one item and maxRows is not set or configured to 1, only that item is returned. Otherwise the whole list. If not specified this value will default to 1. This parameter is only applicable if a selectQuery was provided. Null values are not permitted.
      Parameters:
      maxRows - the number of rows to select. Must not be null.
      Since:
      5.1
      See Also:
    • setKeysGenerated

      public void setKeysGenerated(boolean keysGenerated)
      Flag to indicate that the update query is an insert with auto-generated keys, which will be logged at debug level.
      Parameters:
      keysGenerated - the flag value to set
    • setRequestSqlParameterSourceFactory

      public void setRequestSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory)
    • setRequestPreparedStatementSetter

      public void setRequestPreparedStatementSetter(MessagePreparedStatementSetter requestPreparedStatementSetter)
    • setReplySqlParameterSourceFactory

      public void setReplySqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory)
    • setRowMapper

      public void setRowMapper(RowMapper<?> rowMapper)
    • 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
    • doInit

      protected void doInit()
      Overrides:
      doInit in class AbstractReplyProducingMessageHandler
    • handleRequestMessage

      protected Object handleRequestMessage(Message<?> requestMessage)
      Description copied from class: AbstractReplyProducingMessageHandler
      Subclasses must implement this method to handle the request Message. The return value may be a Message, a MessageBuilder, or any plain Object. The base class will handle the final creation of a reply Message from any of those starting points. If the return value is null, the Message flow will end here.
      Specified by:
      handleRequestMessage in class AbstractReplyProducingMessageHandler
      Parameters:
      requestMessage - The request message.
      Returns:
      The result of handling the message, or null.