Skip to content

Conversation

artembilan
Copy link
Member

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

Auto-cherry-pick to 6.5.x

@artembilan artembilan requested a review from cppwfs October 7, 2025 17:39
Copy link
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Just one question.

}

@Override
protected @Nullable Object handleRequestMessage(Message<?> requestMessage) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to enumerate that a mono is returned when async is true else a AbstractIntegrationMessageBuilder is returned?

…ler`

Fixes: spring-projects#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

**Auto-cherry-pick to `6.5.x`**
@cppwfs
Copy link
Contributor

cppwfs commented Oct 8, 2025

Thank you for the update!

@cppwfs cppwfs merged commit 05dbcd9 into spring-projects:main Oct 8, 2025
3 checks passed
cppwfs pushed a commit to cppwfs/spring-integration that referenced this pull request Oct 8, 2025
…ler` (spring-projects#10469)

* spring-projectsGH-3189: Properly handle `async` in `ScatterGatherHandler`

Fixes: spring-projects#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`**
@artembilan artembilan deleted the GH-3189 branch October 8, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scatter Gather Blocking threads when used along with WebFlux & Netty

2 participants