@Bean
public KafkaPersistencyConfig kafkaConfig() {
return KafkaPersistencyConfig.builder()
.topic(<BASE_TOPIC_NAME>)
.servers(<KAFKA_BOOTSTRAP_SERVERS>)
.messageType(Message.class)
.pollingTimeout(Duration.ofSeconds(30))
.consumerGroup(<CONSUMER_GROUP_NAME>)
.consumerProperties(<CONSUMER_PROPERTIES>)
.build();
}
@Bean
public RetryingConfig retryingConfig() {
return RetryingConfig.builder()
.maxRetries(3)
.pollingInterval(Duration.ofSeconds(1))
.exponentialBackoffMultiplier(15)
.build();
}
@OribiKafkaRetrying
public void methodToRetryOnFailure(String arbitraryVariable) {
throw new RuntimeException(“Exception Occurred”);
}