Skip to content

Commit b55010f

Browse files
committed
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 **Auto-cherry-pick to `3.2.x` & `3.1.x`**
1 parent 6b2ad0d commit b55010f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,9 @@ private void killOrRestart(boolean aborted) {
16011601
private void logConsumerException(Throwable t) {
16021602
if (logger.isDebugEnabled()
16031603
|| !(t instanceof AmqpConnectException || t instanceof ConsumerCancelledException)) {
1604-
logger.debug(
1604+
// It has to be WARN independently of condition.
1605+
// The meaning is: log WARN for all exception when DEBUG enabled, or all others, but mentioned
1606+
logger.warn(
16051607
"Consumer raised exception, processing can restart if the connection factory supports it",
16061608
t);
16071609
}

0 commit comments

Comments
 (0)