GH-2931: AMQP De-Batching as List<?> Payload

Resolves https://github.com/spring-projects/spring-integration/issues/2931
This commit is contained in:
Gary Russell
2019-05-14 15:11:31 -04:00
committed by Artem Bilan
parent e05b6f75f4
commit 9f53b80e18
7 changed files with 202 additions and 3 deletions

View File

@@ -277,8 +277,22 @@ public class AmqpJavaApplication {
----
====
[[amqp-debatching]]
==== Batched Messages
See https://docs.spring.io/spring-amqp/docs/current/reference/html/#template-batching[the Spring AMQP Documentation] for more information about batched messages.
To produce batched messages with Spring Integration, simply configure the outbound endpoint with a `BatchingRabbitTemplate`.
When receiving batched messages, by default, the listener containers extract each fragment message and the adapter will produce a `Message<?>` for each fragment.
Starting with version 5.2, if the container's `deBatchingEnabled` property is set to `false`, the de-batching is performed by the adapter instead, and a single `Message<List<?>>` is produced with the payload being a list of the fragment payloads (after conversion if appropriate).
The default `BatchingStrategy` is the `SimpleBatchingStrategy`, but this can be overridden on the adapter.
=== Polled Inbound Channel Adapter
==== Overview
Version 5.0.1 introduced a polled channel adapter, letting you fetch individual messages on demand -- for example, with a `MessageSourcePollingTemplate` or a poller.
See <<deferred-acks-message-source>> for more information.
@@ -315,6 +329,13 @@ public IntegrationFlow flow() {
----
====
[[amqp-polled-debatching]]
==== Batched Messages
See <<amqp-debatching>>.
For the polled adapter, there is no listener container, batched messages are always debatched (if the `BatchingStrategy` supports doing so).
[[amqp-inbound-gateway]]
=== Inbound Gateway
@@ -453,6 +474,11 @@ public class AmqpJavaApplication {
----
====
[[amqp-gatewway-debatching]]
==== Batched Messages
See <<amqp-debatching>>.
[[amqp-inbound-ack]]
=== Inbound Endpoint Acknowledge Mode

View File

@@ -40,6 +40,9 @@ See <<splitter>> for more information.
The outbound endpoints can now be configured to synthesize a "nack" if no publisher confirm is received within a timeout.
See <<amqp-outbound-endpoints>> for more information.
The inbound channel adapter can now receive batched messages as a `List<?>` payload instead of receiving a discrete message for each batch fragment.
See <<amqp-debatching>> for more information.
[[x5.2-file]]
==== File Changes