GH-2744: ScatterGather: reinstate request headers#2750
Closed
artembilan wants to merge 2 commits intospring-projects:masterfrom
Closed
GH-2744: ScatterGather: reinstate request headers#2750artembilan wants to merge 2 commits intospring-projects:masterfrom
artembilan wants to merge 2 commits intospring-projects:masterfrom
Conversation
Fixes spring-projects#2744 When we get scattering results, there is no reason to keep internal headers any more. * Fix `ScatterGatherHandler` to modify scattering result messages to reinstate headers from original request message. This way we are able to re-throw an exception from the gatherer to the caller.
garyrussell
suggested changes
Feb 14, 2019
Contributor
garyrussell
left a comment
There was a problem hiding this comment.
A few minor nit-picks
| } | ||
| else { | ||
| throw new MessageDeliveryException(message, | ||
| "The 'gatherResultChannel' header is required to delivery gather result."); |
Contributor
There was a problem hiding this comment.
s/delivery/deliver the/
| Such an exception `payload` can be filtered out in the `MessageGroupProcessor` of the gatherer or processed other way downstream, after the scatter-gather endpoint. | ||
|
|
||
| NOTE: Before sending scattering results to the gatherer, `ScatterGatherHandler` reinstates the request message headers, including reply and error channels if any. | ||
| This way errors from the `AggregatingMessageHandler` are going to be propagated to the caller, even if async hand off is applied for scatter recipients. |
Contributor
There was a problem hiding this comment.
s/if async/if an async/
s/applied for scatter recipients/applied in scatter recipient subflows/ ?
| NOTE: Before sending scattering results to the gatherer, `ScatterGatherHandler` reinstates the request message headers, including reply and error channels if any. | ||
| This way errors from the `AggregatingMessageHandler` are going to be propagated to the caller, even if async hand off is applied for scatter recipients. | ||
| In this case a reasonable, finite `gatherTimeout` must be configured for the `ScatterGatherHandler`. | ||
| Otherwise it is going to be blocked waiting for reply from the gatherer forever by default. |
Contributor
There was a problem hiding this comment.
waiting for a reply ... forever, by default
Member
Author
|
Gary, requested changes have been pushed. Thanks |
garyrussell
reviewed
Feb 14, 2019
|
|
||
| NOTE: Before sending scattering results to the gatherer, `ScatterGatherHandler` reinstates the request message headers, including reply and error channels if any. | ||
| This way errors from the `AggregatingMessageHandler` are going to be propagated to the caller, even if async hand off is applied for scatter recipients. | ||
| This way errors from the `AggregatingMessageHandler` are going to be propagated to the caller, even if async an hand off is applied in scatter recipient subflows. |
Contributor
There was a problem hiding this comment.
an async - will fix on merge
Contributor
|
Merged as 0d37566 |
garyrussell
added a commit
to garyrussell/spring-integration
that referenced
this pull request
Mar 16, 2022
Resolves spring-projects#3750 **5.5.x only; removed in 6.0**
artembilan
pushed a commit
that referenced
this pull request
Mar 16, 2022
Resolves #3750 **5.5.x only; removed in 6.0**
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2744
When we get scattering results, there is no reason to keep internal
headers any more.
ScatterGatherHandlerto modify scattering result messages toreinstate headers from original request message.
This way we are able to re-throw an exception from the gatherer to
the caller