Skip to content

Commit 9832f61

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.
1 parent 62fc7df commit 9832f61

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
@@ -349,6 +349,8 @@ public void removeMessageGroup(Object groupId) {
349349
}
350350
};
351351
handler.setMessageStore(messageStore);
352+
// test UniqueExpiryCallback error message
353+
// new AggregatingMessageHandler(new DefaultAggregatingMessageGroupProcessor()).setMessageStore(messageStore);
352354
handler.handleMessage(MessageBuilder.withPayload("foo")
353355
.setCorrelationId(1)
354356
.setSequenceNumber(1)

0 commit comments

Comments
 (0)