Skip to content

Commit

Permalink
GH-2184: Don't Log KafkaBackoffException
Browse files Browse the repository at this point in the history
Resolves #2184

`KafkaBackOffException`s are incorrectly logged at ERROR level during
retries when using the no-seek error handling mode.

They are not logged in the seek mode; see
448871a

**cherry-pick to 2.9.x**
  • Loading branch information
garyrussell authored and artembilan committed Sep 6, 2022
1 parent f1253d4 commit e5d2334
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ public boolean handleOne(Exception thrownException, ConsumerRecord<?, ?> record,
return getFailureTracker().recovered(record, thrownException, container, consumer);
}
catch (Exception ex) {
logger.error(ex, "Failed to handle " + KafkaUtils.format(record) + " with " + thrownException);
if (SeekUtils.isBackoffException(thrownException)) {
this.logger.debug(ex, "Failed to handle " + KafkaUtils.format(record) + " with " + thrownException);
}
else {
this.logger.error(ex, "Failed to handle " + KafkaUtils.format(record) + " with " + thrownException);
}
return false;
}
}
Expand Down

0 comments on commit e5d2334

Please sign in to comment.