diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2024-02-06 10:44:14 +0000 |
---|---|---|
committer | mpriyank <priyank.maheshwari@est.tech> | 2024-02-06 10:44:18 +0000 |
commit | c109ebec4a58f65d0532ca052835e993c4a1273a (patch) | |
tree | 931bbfec6ccd00254c3a00d305b9f093994fe771 /cps-ncmp-service/src | |
parent | 39b02f20a8baf1ba6295e6b995eca92598e6e9f2 (diff) |
[BUG] Retry interval for kafka consumer
- added retry interval of 10 seconds in case of any auth exception when
consuming kafka messages.
- This fix prevents us from restarting the whole app inorder to restart
the consumer.
Issue-ID: CPS-2070
Change-Id: Ie02d3cb686741cd92dd006dab1d49c3480d58720
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-ncmp-service/src')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/kafka/KafkaConfig.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/kafka/KafkaConfig.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/kafka/KafkaConfig.java index 514967574f..4f2674aca3 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/kafka/KafkaConfig.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/kafka/KafkaConfig.java @@ -21,6 +21,7 @@ package org.onap.cps.ncmp.api.impl.config.kafka; import io.cloudevents.CloudEvent; +import java.time.Duration; import java.util.Map; import lombok.RequiredArgsConstructor; import org.apache.kafka.clients.producer.ProducerConfig; @@ -99,6 +100,7 @@ public class KafkaConfig<T> { final ConcurrentKafkaListenerContainerFactory<String, T> containerFactory = new ConcurrentKafkaListenerContainerFactory<>(); containerFactory.setConsumerFactory(legacyEventConsumerFactory()); + containerFactory.getContainerProperties().setAuthExceptionRetryInterval(Duration.ofSeconds(10)); return containerFactory; } @@ -150,6 +152,7 @@ public class KafkaConfig<T> { final ConcurrentKafkaListenerContainerFactory<String, CloudEvent> containerFactory = new ConcurrentKafkaListenerContainerFactory<>(); containerFactory.setConsumerFactory(cloudEventConsumerFactory()); + containerFactory.getContainerProperties().setAuthExceptionRetryInterval(Duration.ofSeconds(10)); return containerFactory; } |