You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolves#1319
- change the release strategy to a `BiConsumer`
- call the strategy during normal message delivery as before
- now call the strategy when releasing a partial result after timeout
- allow the strategy to modify the list (change from `Collection` to `List`).
**cherry-pick to 2.3.x**
Copy file name to clipboardExpand all lines: src/reference/asciidoc/kafka.adoc
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -503,11 +503,15 @@ The template in <<replying-template>> is strictly for a single request/reply sce
503
503
For cases where multiple receivers of a single message return a reply, you can use the `AggregatingReplyingKafkaTemplate`.
504
504
This is an implementation of the client-side of the https://www.enterpriseintegrationpatterns.com/patterns/messaging/BroadcastAggregate.html[Scatter-Gather Enterprise Integration Pattern].
505
505
506
-
Like the `ReplyingKafkaTemplate`, the `AggregatingReplyingKafkaTemplate` constructor takes a producer factory and a listener container to receive the replies; it has a third parameter `Predicate<Collection<ConsumerRecord<K, R>>> releaseStrategy` which is consulted each time a reply is received; when the predicate returns `true`, the collection of `ConsumerRecord` s is used to complete the `Future` returned by the `sendAndReceive` method.
506
+
Like the `ReplyingKafkaTemplate`, the `AggregatingReplyingKafkaTemplate` constructor takes a producer factory and a listener container to receive the replies; it has a third parameter `BiPredicate<List<ConsumerRecord<K, R>>, Boolean> releaseStrategy` which is consulted each time a reply is received; when the predicate returns `true`, the collection of `ConsumerRecord` s is used to complete the `Future` returned by the `sendAndReceive` method.
507
507
508
508
There is an additional property `returnPartialOnTimeout` (default false).
509
509
When this is set to `true`, instead of completing the future with a `KafkaReplyTimeoutException`, a partial result completes the future normally (as long as at least one reply record has been received).
510
510
511
+
Starting with version 2.3.5, the predicate is also called after a timeout (if `returnPartialOnTimeout` is `true`).
512
+
The first argument is the current list of records; the second is `true` if this call is due to a timeout.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/whats-new.adoc
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Also see <<new-in-sik>>.
7
7
[[kafka-client-2.4]]
8
8
==== Kafka Client Version
9
9
10
-
This version requires the 2.4.0 `kafka-clients` or higher.
10
+
This version requires the 2.4.0 `kafka-clients` or higher and supports the new incremental rebalancing feature.
11
11
12
12
[[x24-carl]]
13
13
==== ConsumerAwareRabalanceListener
@@ -25,6 +25,14 @@ See the IMPORTANT note at the end of <<rebalance-listeners>> for more informatio
25
25
26
26
The `isAckAfterHandle()` default implementation now returns true by default.
27
27
28
+
[[x24-agg]]
29
+
==== AggregatingReplyingKafkaTemplate
30
+
31
+
The `releastStrategy` is now a `BiConsumer`.
32
+
It is now called after a timeout (as well as when records arrive); the second parameter is `true` in the case of a call after a timeout.
33
+
34
+
See <<aggregating-request-reply>> for more information.
35
+
28
36
=== Migration Guide
29
37
30
38
* This release is essentially the same as the 2.3.x line, except it has been compiled against the 2.4 `kafka-clients` jar, due to a binary incompatibility.
0 commit comments