diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp')
4 files changed, 20 insertions, 8 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java index 9d428c812a..334b3f63d9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java @@ -94,7 +94,6 @@ public class DistributionEngine implements IDistributionEngine { @PostConstruct private void init() { - LOGGER.trace("Enter init method of DistributionEngine"); DistributionEngineConfiguration distributionEngineConfiguration = ConfigurationManager.getConfigurationManager().getDistributionEngineConfiguration(); @@ -131,7 +130,6 @@ public class DistributionEngine implements IDistributionEngine { distributionEngineClusterHealth.startHealthCheckTask(envNamePerStatus); LOGGER.trace("Exit init method of DistributionEngine"); - } @PreDestroy diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java index b48ed78190..653c9c6510 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java @@ -73,6 +73,10 @@ public class DmaapHealth { @PostConstruct public DmaapHealth init() { + if(!ConfigurationManager.getConfigurationManager().getConfiguration().getDmaapConsumerConfiguration().isActive()){ + log.debug("Dmaap health check task disabled"); + return this; + } log.trace("Enter init method of Dmaap health"); synchronized (DmaapHealth.class){ this.configuration = ConfigurationManager.getConfigurationManager().getConfiguration().getDmaapConsumerConfiguration(); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java index 7eb00ba988..9a875e5d48 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java @@ -51,7 +51,7 @@ public class EnvironmentsEngine implements INotificationHandler { private static final Logger log = Logger.getLogger(EnvironmentsEngine.class.getName()); private ConfigurationManager configurationManager = ConfigurationManager.getConfigurationManager(); - private Map<String, OperationalEnvironmentEntry> environments; + private Map<String, OperationalEnvironmentEntry> environments = new HashMap<>(); private Map<String, AtomicBoolean> envNamePerStatus = new HashMap<>(); private Map<String, DistributionEnginePollingTask> envNamePerPollingTask = new HashMap<>(); private Map<String, DistributionEngineInitTask> envNamePerInitTask = new HashMap<>(); @@ -79,13 +79,17 @@ public class EnvironmentsEngine implements INotificationHandler { @VisibleForTesting @PostConstruct void init() { - log.trace("Environments engine has been initialized. "); try { environments = populateEnvironments(); createUebTopicsForEnvironments(); initDmeGlobalConfig(); + if(!configurationManager.getConfiguration().getDmaapConsumerConfiguration().isActive()){ + log.info("Environments engine is disabled"); + return; + } dmaapConsumer.consumeDmaapTopic(this::handleMessage, - (t, e) -> log.error("An error occurred upon consuming topic by Dmaap consumer client: ", e)); + (t, e) -> log.error("An error occurred upon consuming topic by Dmaap consumer client: ", e)); + log.info("Environments engine has been initialized."); } catch (Exception e) { log.error("An error occurred upon consuming topic by Dmaap consumer client.", e); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java index be534f326a..c0a89d6954 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java @@ -126,6 +126,7 @@ public class HealthCheckBusinessLogic { //Dmaap getDmaapHealthCheck(healthCheckInfos); + // BE getBeHealthCheck(healthCheckInfos); @@ -182,9 +183,14 @@ public class HealthCheckBusinessLogic { } private List<HealthCheckInfo> getDmaapHealthCheck(List<HealthCheckInfo> healthCheckInfos) { - String appVersion = getAppVersion(); - dmaapHealth.getHealthCheckInfo().setVersion(appVersion); - healthCheckInfos.add(dmaapHealth.getHealthCheckInfo()); + if(ConfigurationManager.getConfigurationManager().getConfiguration().getDmaapConsumerConfiguration().isActive()){ + String appVersion = getAppVersion(); + dmaapHealth.getHealthCheckInfo().setVersion(appVersion); + healthCheckInfos.add(dmaapHealth.getHealthCheckInfo()); + } else { + log.debug("Dmaap health check disabled"); + } + return healthCheckInfos; } |