Skip to content

Commit da0b820

Browse files
tomazfernandesgaryrussell
authored andcommitted
GH-2184 KafkaBackOffException logged as ERROR
Fixes #2184
1 parent 5df194e commit da0b820

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
@@ -183,8 +183,14 @@ protected RecoveryStrategy getRecoveryStrategy(List<ConsumerRecord<?, ?>> record
183183
}
184184
catch (Exception ex) {
185185
if (records.size() > 0) {
186-
this.logger.error(ex, () -> "Recovery of record ("
187-
+ ListenerUtils.recordToString(records.get(0)) + ") failed");
186+
if (SeekUtils.isBackoffException(ex)) {
187+
this.logger.debug("Recovery of record ("
188+
+ ListenerUtils.recordToString(records.get(0)) + ") backed off: " + ex.getMessage());
189+
}
190+
else {
191+
this.logger.error(ex, () -> "Recovery of record ("
192+
+ ListenerUtils.recordToString(records.get(0)) + ") failed");
193+
}
188194
this.failureTracker.getRetryListeners().forEach(rl ->
189195
rl.recoveryFailed(records.get(0), thrownException, ex));
190196
}

0 commit comments

Comments
 (0)