Spring integration 使用DSL的Spring集成JDBC出站通道适配器

Spring integration 使用DSL的Spring集成JDBC出站通道适配器,spring-integration,Spring Integration,有没有办法使用DSL指定JDBC出站通道适配器 e、 g 还可以处理可能为null的参数(例如,如果字段为null,则替换为空字符串值)。根据说明: <xsd:documentation> Configures a Consumer Endpoint for the 'org.springframework.integration.jdbc.JdbcMessageHandler' for updating a

有没有办法使用DSL指定JDBC出站通道适配器

e、 g


还可以处理可能为null的参数(例如,如果字段为null,则替换为空字符串值)。

根据
说明:

 <xsd:documentation>
            Configures a Consumer Endpoint for the
            'org.springframework.integration.jdbc.JdbcMessageHandler' for updating a
            database.
        </xsd:documentation>

null->empty string
可以通过自定义
SqlParameterSourceFactory

来实现。多亏了Artem,这使我能够更灵活地自定义插入。干杯。
 <xsd:documentation>
            Configures a Consumer Endpoint for the
            'org.springframework.integration.jdbc.JdbcMessageHandler' for updating a
            database.
        </xsd:documentation>
@Bean
public MessageHandler jdbcMessageHandler() {
    JdbcMessageHandler handler = new JdbcMessageHandler(this.dataSource,
       "insert into foos (id, status, name) values (:headers[id], 0, :payload[foo])");
    return handler;
}

@Bean
public IntegrationFlow jdbcFlow() {
      ...
      .handle(jdbcMessageHandler())
      ...
}