X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=enrichment-coordinator-service%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fenrichment%2Ftasks%2FProducerSupervision.java;h=d8ee97071069173f9fbbd94d14ef6828126938ff;hb=b61264738a459de5f1b9333ee4cb486df9f3b9f4;hp=f239a4876001eb05b7299bc261a77d78fc4b3b4d;hpb=b5aa1b04fe2cf730c434e3d5d103b3ab357f2292;p=nonrtric.git diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/tasks/ProducerSupervision.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/tasks/ProducerSupervision.java index f239a487..d8ee9707 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/tasks/ProducerSupervision.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/tasks/ProducerSupervision.java @@ -23,6 +23,7 @@ package org.oransc.enrichment.tasks; import org.oransc.enrichment.clients.AsyncRestClient; import org.oransc.enrichment.clients.AsyncRestClientFactory; import org.oransc.enrichment.configuration.ApplicationConfig; +import org.oransc.enrichment.controllers.consumer.ConsumerCallbacks; import org.oransc.enrichment.repository.EiJobs; import org.oransc.enrichment.repository.EiProducer; import org.oransc.enrichment.repository.EiProducers; @@ -50,15 +51,17 @@ public class ProducerSupervision { private final EiJobs eiJobs; private final EiTypes eiTypes; private final AsyncRestClient restClient; + private final ConsumerCallbacks consumerCallbacks; @Autowired public ProducerSupervision(ApplicationConfig applicationConfig, EiProducers eiProducers, EiJobs eiJobs, - EiTypes eiTypes) { + EiTypes eiTypes, ConsumerCallbacks consumerCallbacks) { AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(applicationConfig.getWebClientConfig()); - this.restClient = restClientFactory.createRestClient(""); + this.restClient = restClientFactory.createRestClientNoHttpProxy(""); this.eiJobs = eiJobs; this.eiProducers = eiProducers; this.eiTypes = eiTypes; + this.consumerCallbacks = consumerCallbacks; } @Scheduled(fixedRate = 1000 * 60 * 5) @@ -86,7 +89,8 @@ public class ProducerSupervision { logger.warn("Unresponsive producer: {} exception: {}", producer.getId(), throwable.getMessage()); producer.setAliveStatus(false); if (producer.isDead()) { - this.eiProducers.deregisterProducer(producer, this.eiTypes, this.eiJobs); + this.eiProducers.deregisterProducer(producer, this.eiTypes); + this.consumerCallbacks.notifyConsumersProducerDeleted(producer); } }