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
GH-3189: Properly handle async in ScatterGatherHandler (#10469)
* GH-3189: Properly handle `async` in `ScatterGatherHandler`
Fixes: #3189
Despite supporting `async = true`, the `ScatterGatherHandler`
does blocking in its `handleRequestMessage()`
on the `gatherResultChannel.receive()` call.
* Fix `ScatterGatherHandler` to handle an `async` mode via internal `Mono`
for the reply object
* Use pattern variable expressions for `ifs` in the `ScatterGatherHandler.doInit()`
for the better readability
* Extract `ScatterGatherHandler.replyFromGatherResult()` method to avoid code duplication
* Document a new (fixed) functionality
* Mention `Mono` reply in the `ScatterGatherHandler` Javadocs
**Auto-cherry-pick to `6.5.x`**
Copy file name to clipboardExpand all lines: spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/scatter-gather.adoc
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,6 +154,10 @@ Mutually exclusive with `scatter-channel` attribute.
154
154
<13> The `<aggregator>` options.
155
155
Required.
156
156
157
+
NOTE: Starting with version `6.5.3`, when a `ScatterGatherHandler` is configured for the `async = true` option, the request message handling thread is not blocked anymore waiting for a gather result on an internal `((PollableChannel) gatherResultChannel).receive(this.gatherTimeout)` operation.
158
+
Instead, a `reactor.core.publisher.Mono` is returned as a reply object based on a gather result eventually produced from the `gatherResultChannel`.
159
+
Such a `Mono` is handled then according to the xref:reactive-streams.adoc#reactive-reply-payload[Reactive Streams support] in the framework.
0 commit comments