Last active
November 16, 2018 15:13
-
-
Save schroedermatt/d880d24abcecef51b465890471204f08 to your computer and use it in GitHub Desktop.
A snippet showing how to configure a RetryTemplate on a KafkaListenerContainer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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