Skip to content

Commit e601637

Browse files
spring-projectsGH-2184 KafkaBackOffException logged as ERROR
Fixes spring-projects#2184
1 parent 1d13671 commit e601637

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/FailedRecordProcessor.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,14 @@ protected RecoveryStrategy getRecoveryStrategy(List<ConsumerRecord<?, ?>> record
152152
}
153153
catch (Exception ex) {
154154
if (records.size() > 0) {
155-
this.logger.error(ex, () -> "Recovery of record ("
156-
+ KafkaUtils.format(records.get(0)) + ") failed");
155+
if (SeekUtils.isBackoffException(ex)) {
156+
this.logger.debug("Recovery of record ("
157+
+ KafkaUtils.format(records.get(0)) + ") backed off: " + ex.getMessage());
158+
}
159+
else {
160+
this.logger.error(ex, () -> "Recovery of record ("
161+
+ KafkaUtils.format(records.get(0)) + ") failed");
162+
}
157163
this.failureTracker.getRetryListeners().forEach(rl ->
158164
rl.recoveryFailed(records.get(0), thrownException, ex));
159165
}

0 commit comments

Comments
 (0)