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

**Auto-cherry-pick to `6.3.x`**
  • Loading branch information
mitchmcd18 authored Dec 10, 2024
1 parent dd7dd09 commit 7fc104a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,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 7fc104a

Please sign in to comment.