Skip to content

Instantly share code, notes, and snippets.

@Daniel-Jacob
Last active March 4, 2022 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daniel-Jacob/7cec1b3f2dc379df948ffcb03f0c3118 to your computer and use it in GitHub Desktop.
Save Daniel-Jacob/7cec1b3f2dc379df948ffcb03f0c3118 to your computer and use it in GitHub Desktop.
kafka config for exponential backoff
@Bean
fun errorHandler(kafkaProperties: KafkaProperties): DefaultErrorHandler =
run {
val backOff = ExponentialBackOff(3000, 2.0)
backOff.maxElapsedTime = 60000
DefaultErrorHandler(DeadLetterPublishingRecoverer(errorKafkaTemplate(kafkaProperties)), backOff)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment