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.
This commit is contained in:
Gary Russell
2018-12-04 14:55:51 -05:00
committed by Artem Bilan
parent 62fc7df693
commit 9832f61d2a
2 changed files with 3 additions and 1 deletions

View File

@@ -112,7 +112,7 @@ public abstract class AbstractMessageGroupStore extends AbstractBatchingMessageG
this.expiryCallbacks.stream()
.anyMatch(UniqueExpiryCallback.class::isInstance);
if (!uniqueExpiryCallbackPresent && this.logger.isErrorEnabled()) {
if (uniqueExpiryCallbackPresent && this.logger.isErrorEnabled()) {
this.logger.error("Only one instance of 'UniqueExpiryCallback' can be registered in the " +
"'MessageGroupStore'. Use a separate 'MessageGroupStore' for each aggregator/resequencer.");
}

View File

@@ -349,6 +349,8 @@ public class AbstractCorrelatingMessageHandlerTests {
}
};
handler.setMessageStore(messageStore);
// test UniqueExpiryCallback error message
// new AggregatingMessageHandler(new DefaultAggregatingMessageGroupProcessor()).setMessageStore(messageStore);
handler.handleMessage(MessageBuilder.withPayload("foo")
.setCorrelationId(1)
.setSequenceNumber(1)