Skip to content

Commit 7a2547f

Browse files
garyrussellartembilan
authored andcommitted
INT-4564: ACMH: Fix erroneous error log
JIRA: https://jira.spring.io/browse/INT-4564 INT-4550 added an error log when multiple ACMHs were registered with the same store; the error log logic was incorrect and the error was logged when the first ACMH was registered. (cherry picked from commit 9832f61)
1 parent be64980 commit 7a2547f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void registerMessageGroupExpiryCallback(MessageGroupCallback callback) {
112112
this.expiryCallbacks.stream()
113113
.anyMatch(UniqueExpiryCallback.class::isInstance);
114114

115-
if (!uniqueExpiryCallbackPresent && this.logger.isErrorEnabled()) {
115+
if (uniqueExpiryCallbackPresent && this.logger.isErrorEnabled()) {
116116
this.logger.error("Only one instance of 'UniqueExpiryCallback' can be registered in the " +
117117
"'MessageGroupStore'. Use a separate 'MessageGroupStore' for each aggregator/resequencer.");
118118
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ public void removeMessageGroup(Object groupId) {
348348
}
349349
};
350350
handler.setMessageStore(messageStore);
351+
// test UniqueExpiryCallback error message
352+
// new AggregatingMessageHandler(new DefaultAggregatingMessageGroupProcessor()).setMessageStore(messageStore);
351353
handler.handleMessage(MessageBuilder.withPayload("foo")
352354
.setCorrelationId(1)
353355
.setSequenceNumber(1)

0 commit comments

Comments
 (0)