aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java
diff options
context:
space:
mode:
authorsushant53 <sushant.jadhav@t-systems.com>2023-10-27 16:44:30 +0530
committersushant53 <sushant.jadhav@t-systems.com>2023-10-27 16:45:02 +0530
commit62841e53e41fd8e12b75641806f76c11878260ee (patch)
tree624bc532ae85647cb8b5cb470ad3549be167473e /prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java
parentd82c53bd799b22660be17219da516415d4c56b46 (diff)
[DCAEGEN2] Remove DMaaP dependency in PRH1.10.1
Removed DMaaP dependency in PRH by using new sdk library, which uses Kafka API directly. Issue-ID: DCAEGEN2-3402 Change-Id: I5456ce432a9fd4a58826275a17c603379b0c18ee Signed-off-by: sushant53 <sushant.jadhav@t-systems.com>
Diffstat (limited to 'prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java
index 64fff9a7..22763e8b 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CbsConfiguration.java
@@ -58,7 +58,14 @@ public class CbsConfiguration implements Config {
messageRouterSubscriber = DmaapClientFactory
.createMessageRouterSubscriber(consulConfigurationParser.getMessageRouterSubscriberConfig());
+ String prevTopicUrl = null;
+ if(messageRouterCBSSubscribeRequest != null) {
+ prevTopicUrl = messageRouterCBSSubscribeRequest.sourceDefinition().topicUrl();
+ }
messageRouterCBSSubscribeRequest = consulConfigurationParser.getMessageRouterSubscribeRequest();
+ if(!messageRouterCBSSubscribeRequest.sourceDefinition().topicUrl().equals(prevTopicUrl)) {
+ messageRouterSubscriber.close();
+ }
}
@Override
@@ -95,5 +102,4 @@ public class CbsConfiguration implements Config {
.orElseThrow(() -> new RuntimeException(CBS_CONFIG_MISSING));
}
-
}