Skip to content

Instantly share code, notes, and snippets.

@schroedermatt
Last active November 16, 2018 15:13
Show Gist options
  • Save schroedermatt/d880d24abcecef51b465890471204f08 to your computer and use it in GitHub Desktop.
Save schroedermatt/d880d24abcecef51b465890471204f08 to your computer and use it in GitHub Desktop.
A snippet showing how to configure a RetryTemplate on a KafkaListenerContainer
@Bean
public KafkaListenerContainerFactory kafkaListenerContainerFactory(RetryTemplate retryTemplate) {
def factory = /** configure factory **/
// configure the listener container factory with retry support
factory.setRetryTemplate(retryTemplate);
factory.setRecoveryCallback(context -> {
log.error("RetryPolicy limit has been exceeded! You should really handle this better.");
return null;
});
return factory;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment