From 94ad225b6cc32fa4bf51e14f6ba529120ff2b4c8 Mon Sep 17 00:00:00 2001 From: Jiandong Date: Fri, 2 May 2025 23:45:01 +0800 Subject: [PATCH] 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 Co-authored by: Artem Bilan (cherry picked from commit c58e21806f1f5dddb639f6819921e4e90462a6ab) --- .../aggregator/AbstractCorrelatingMessageHandler.java | 2 +- .../integration/aggregator/AggregatorTests.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java index 911101139b..59629ab4f1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java @@ -282,7 +282,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; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java index 12369cd16a..0e667a06d5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java @@ -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);