Bugfix 79/7579/1
authorPatrikBuhr <patrik.buhr@est.tech>
Wed, 19 Jan 2022 09:19:23 +0000 (10:19 +0100)
committerPatrikBuhr <patrik.buhr@est.tech>
Wed, 19 Jan 2022 09:19:23 +0000 (10:19 +0100)
All kafka listeners was restared every minute. But only broken ones should be restarted.
This would lead to lost data.

Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-703
Change-Id: I876f946b0de73f39ada5a975a5e325a3952ae744

dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaTopicConsumers.java

index 4809017..5233401 100644 (file)
@@ -100,7 +100,9 @@ public class KafkaTopicConsumers {
     public synchronized void restartNonRunningTopics() {
         for (String typeId : this.consumers.keySet()) {
             for (KafkaJobDataConsumer consumer : this.consumers.get(typeId)) {
-                restartTopic(consumer);
+                if (!consumer.isRunning()) {
+                    restartTopic(consumer);
+                }
             }
         }
     }