Skip to content

Commit

Permalink
GH-9705: AbstractReplyProducingMessageHandler: check for logging enabled
Browse files Browse the repository at this point in the history
Fixes: #9705
Issue link: #9705

Currently when any class that implements `AbstractReplyProducingMessageHandler` doesn't produce a reply it will log the message, even if no reply is required.
The message should only be logged if `isLoggingEnabled()` returns true as a handler that doesn't require a reply may be a normal operation that is expected, and if we've set `loggingEnabled` to false it shouldn't log the message.

* Prevent logging when no reply is provided for an `AbstractReplyProducingMessageHandler` if logging is disabled

(cherry picked from commit 7fc104a)
  • Loading branch information
mitchmcd18 authored and spring-builds committed Dec 10, 2024
1 parent a10814d commit 1071c3c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ else if (this.requiresReply && !isAsync()) {
throw new ReplyRequiredException(message, "No reply produced by handler '" +
getComponentName() + "', and its 'requiresReply' property is set to true.");
}
else if (!isAsync()) {
else if (!isAsync() && isLoggingEnabled()) {
logger.debug(LogMessage.format("handler '%s' produced no reply for request Message: %s", this, message));
}
}
Expand Down

0 comments on commit 1071c3c

Please sign in to comment.