Skip to content

Commit ff7e189

Browse files
committed
Fix releasePartialSequences value propagation for SequenceSizeReleaseStrategy.
Fixes: spring-projects#10003 Issue Link: spring-projects#10003 Signed-off-by: Jiandong Ma <[email protected]>
1 parent 05ee9ff commit ff7e189

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public void setMinimumTimeoutForEmptyGroups(long minimumTimeoutForEmptyGroups) {
299299
*/
300300
public void setReleasePartialSequences(boolean releasePartialSequences) {
301301
if (!this.releaseStrategySet && releasePartialSequences) {
302-
setReleaseStrategy(new SequenceSizeReleaseStrategy());
302+
setReleaseStrategy(new SequenceSizeReleaseStrategy(releasePartialSequences));
303303
}
304304
this.releasePartialSequences = releasePartialSequences;
305305
}

spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -152,6 +152,8 @@ public void testAggPerfDefaultPartial() throws InterruptedException, ExecutionEx
152152
store.setMessageGroupFactory(messageGroupFactory);
153153

154154
handler.setMessageStore(store);
155+
handler.setBeanFactory(mock(BeanFactory.class));
156+
handler.afterPropertiesSet();
155157

156158
StopWatch stopwatch = new StopWatch();
157159
stopwatch.start();
@@ -173,7 +175,7 @@ public void testAggPerfDefaultPartial() throws InterruptedException, ExecutionEx
173175

174176
Collection<?> result = resultFuture.get(10, TimeUnit.SECONDS);
175177
assertThat(result).isNotNull();
176-
assertThat(result.size()).isEqualTo(120000);
178+
assertThat(result.size()).isEqualTo(1);
177179
assertThat(stopwatch.getTotalTimeSeconds()).isLessThan(60.0); // actually < 2.0, was many minutes
178180
}
179181

0 commit comments

Comments
 (0)