GH-10003: Fix AbstractCorrelatingMessageHandler for releasePartialSequences propagation

Fixes: #10003
Issue Link: https://github.com/spring-projects/spring-integration/issues/10003

The `AbstractCorrelatingMessageHandler`.setReleasePartialSequences()` populates a `SequenceSizeReleaseStrategy`,
but don't propagate the `releasePartialSequences` into that strategy for its "partial" logic.

Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
Co-authored by: Artem Bilan <artem.bilan@broadcom.com>
(cherry picked from commit c58e21806f)
This commit is contained in:
Jiandong
2025-05-02 23:45:01 +08:00
committed by Spring Builds
parent 4a8caef467
commit ea25d57e1d
2 changed files with 2 additions and 3 deletions

View File

@@ -283,7 +283,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
*/
public void setReleasePartialSequences(boolean releasePartialSequences) {
if (!this.releaseStrategySet && releasePartialSequences) {
setReleaseStrategy(new SequenceSizeReleaseStrategy());
setReleaseStrategy(new SequenceSizeReleaseStrategy(releasePartialSequences));
}
this.releasePartialSequences = releasePartialSequences;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -133,7 +133,6 @@ public class AggregatorTests {
public void testAggPerfDefaultPartial() throws InterruptedException, ExecutionException, TimeoutException {
AggregatingMessageHandler handler = new AggregatingMessageHandler(new DefaultAggregatingMessageGroupProcessor());
handler.setCorrelationStrategy(message -> "foo");
handler.setReleasePartialSequences(true);
DirectChannel outputChannel = new DirectChannel();
handler.setOutputChannel(outputChannel);