From 0f7d74f6be3b182654f726b2b815a8290da08a88 Mon Sep 17 00:00:00 2001 From: Sreeja Gattagouni Date: Fri, 21 Apr 2023 05:10:34 +0000 Subject: Add or Delete a PNF to an Active Service -Unique values for ready & update -concurrent changes in OOM/Configmap of so-bpm-infra-app Issue-ID: SO-4046 Change-ID: I73f97f986a817d423f92f8d925dcd0347b8a0405 Signed-off-by: Sreeja Gattagouni Signed-off-by: Lukasz Rajewski --- .../pnf/dmaap/PnfEventReadyDmaapClient.java | 30 ++++++++-------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-common/src/main') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java index 1a253887dd..f215d496cf 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java @@ -50,7 +50,8 @@ public class PnfEventReadyDmaapClient implements DmaapClient { private int topicListenerDelayInSeconds; private volatile ScheduledThreadPoolExecutor executor; private volatile boolean dmaapThreadListenerIsRunning; - private String topicName; + + @Autowired public PnfEventReadyDmaapClient(Environment env) { @@ -58,31 +59,19 @@ public class PnfEventReadyDmaapClient implements DmaapClient { pnfCorrelationIdToThreadMap = new ConcurrentHashMap<>(); topicListenerDelayInSeconds = env.getProperty("pnf.dmaap.topicListenerDelayInSeconds", Integer.class); executor = null; - topicName = env.getProperty("pnf.dmaap.topicName"); - String[] topic = topicName.split("\\s"); - String pnf_ready = null; - String pnf_update = null; - for (String t : topic) { - if (t.matches("(.*)PNF_READY(.*)")) { - pnf_ready = t; - } else if (t.matches("(.*)PNF_UPDATE(.*)")) { - pnf_update = t; - } else { - return; - } - } getRequestForpnfReady = new HttpGet(UriBuilder.fromUri(env.getProperty("pnf.dmaap.uriPathPrefix")) .scheme(env.getProperty("pnf.dmaap.protocol")).host(env.getProperty("pnf.dmaap.host")) - .port(env.getProperty("pnf.dmaap.port", Integer.class)).path(pnf_ready) - .path(env.getProperty("pnf.dmaap.consumerGroup")).path(env.getProperty("pnf.dmaap.consumerId")) - .build()); + .port(env.getProperty("pnf.dmaap.port", Integer.class)) + .path(env.getProperty("pnf.dmaap.pnfReadyTopicName")).path(env.getProperty("pnf.dmaap.consumerGroup")) + .path(env.getProperty("pnf.dmaap.consumerId")).build()); getRequestForPnfUpdate = new HttpGet(UriBuilder.fromUri(env.getProperty("pnf.dmaap.uriPathPrefix")) .scheme(env.getProperty("pnf.dmaap.protocol")).host(env.getProperty("pnf.dmaap.host")) - .port(env.getProperty("pnf.dmaap.port", Integer.class)).path(pnf_update) - .path(env.getProperty("pnf.dmaap.consumerGroup")).path(env.getProperty("pnf.dmaap.consumerId")) - .build()); + .port(env.getProperty("pnf.dmaap.port", Integer.class)) + .path(env.getProperty("pnf.dmaap.pnfUpdateTopicName")).path(env.getProperty("pnf.dmaap.consumerGroup")) + .path(env.getProperty("pnf.dmaap.consumerIdUpdate")).build()); } + @Override public synchronized void registerForUpdate(String pnfCorrelationId, Runnable informConsumer) { logger.debug("registering for pnf ready dmaap event for pnf correlation id: {}", pnfCorrelationId); @@ -162,3 +151,4 @@ public class PnfEventReadyDmaapClient implements DmaapClient { } } } + -- cgit 1.2.3-korg