Skip to content

Commit 88c04bb

Browse files
artembilanspring-builds
authored andcommitted
GH-3008: Fix SimpleMLC.logConsumerException for warn
Fixes: #3008 Issue link: #3008 The real problem in consumer (e.g. `ClassCastException` mentioned in the issue) might be lost if DEBUG logging level is not enabled * Fix the first condition in the `SimpleMessageListenerContainer.logConsumerException()` to use `logger.warn()` as it was before #2278 fix (cherry picked from commit b55010f)
1 parent 6afe725 commit 88c04bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,9 @@ private void killOrRestart(boolean aborted) {
15761576
private void logConsumerException(Throwable t) {
15771577
if (logger.isDebugEnabled()
15781578
|| !(t instanceof AmqpConnectException || t instanceof ConsumerCancelledException)) {
1579-
logger.debug(
1579+
// It has to be WARN independently of condition.
1580+
// The meaning is: log WARN for all exception when DEBUG enabled, or all others, but mentioned
1581+
logger.warn(
15801582
"Consumer raised exception, processing can restart if the connection factory supports it",
15811583
t);
15821584
}

0 commit comments

Comments
 (0)