INT-3364: Add batchUpdate into JdbcMessageHandler (#2534)
* INT-3364: Add batchUpdate into JdbcMessageHandler JIRA: https://jira.spring.io/browse/INT-3364 * * Optimize items mapping with an internal `Message` implementation * Polishing Docs and Javadocs
This commit is contained in:
committed by
Gary Russell
parent
34ac66df1c
commit
4a85849bcc
@@ -261,7 +261,15 @@ public MessageHandler jdbcMessageHandler(DataSource dataSource) {
|
||||
====
|
||||
|
||||
From the XML configuration perspective, the `prepared-statement-setter` attribute is available on the `<int-jdbc:outbound-channel-adapter>` component.
|
||||
It lets you specify a `MessagePreparedStatementSetter` bean reference.
|
||||
It lets you specify a `MessagePreparedStatementSetter` bean reference.
|
||||
|
||||
==== Batch Update
|
||||
|
||||
Starting with version 5.1, the `JdbcMessageHandler` performs a `JdbcOperations.batchUpdate()` if the payload of the request message is an `Iterable` instance.
|
||||
Each element of the `Iterable` is wrapped to a `Message` with the headers from the request message.
|
||||
In the case of regular `SqlParameterSourceFactory`-based configuration these messages are used to build an `SqlParameterSource[]` for an argument used in the mentioned `JdbcOperations.batchUpdate()` function.
|
||||
When a `MessagePreparedStatementSetter` configuration is applied, a `BatchPreparedStatementSetter` variant is used to iterate over those messages for each item and the provided `MessagePreparedStatementSetter` is called against them.
|
||||
The batch update is not supported when `keysGenerated` mode is selected.
|
||||
|
||||
[[jdbc-outbound-gateway]]
|
||||
=== Outbound Gateway
|
||||
|
||||
@@ -109,6 +109,8 @@ See <<amqp-content-type>> for more information.
|
||||
|
||||
A confusing `max-rows-per-poll` property on the JDBC Inbound Channel Adapter and JDBC Outbound Gateway has been deprecated in favor of the newly introduced `max-rows` property.
|
||||
|
||||
The `JdbcMessageHandler` supports now a `batchUpdate` functionality when the payload of the request message is an instance of an `Iterable` type.
|
||||
|
||||
See <<jdbc>> for more information.
|
||||
|
||||
[[x5.1-ftp-sftp]]
|
||||
|
||||
Reference in New Issue
Block a user