X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Fdmaap%2FDmaapMessageConsumer.java;h=0ee621322c05a3ba7a64c3d7142e09e32edc6e8a;hb=c75f4b117df1c9dd9ff5fb0e370b5fc52130407f;hp=e141babd25e2e62d3620c503d9c89c259d3616f9;hpb=f45eedd18774bf9856800b43387bee3fa2e6152d;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java b/policy-agent/src/main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java index e141babd..0ee62132 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java @@ -25,7 +25,6 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonParser; -import java.io.IOException; import java.time.Duration; import java.util.ArrayList; import java.util.List; @@ -129,7 +128,7 @@ public class DmaapMessageConsumer { return result; } - protected Iterable fetchAllMessages() throws ServiceException, IOException { + protected Iterable fetchAllMessages() throws ServiceException { String topicUrl = this.applicationConfig.getDmaapConsumerTopicUrl(); AsyncRestClient consumer = getMessageRouterConsumer(); ResponseEntity response = consumer.getForEntity(topicUrl).block(); @@ -142,15 +141,16 @@ public class DmaapMessageConsumer { } } - private void processMsg(String msg) throws IOException { + private void processMsg(String msg) { logger.debug("Message Reveived from DMAAP : {}", msg); getDmaapMessageHandler().handleDmaapMsg(msg); } - protected DmaapMessageHandler getDmaapMessageHandler() throws IOException { + protected DmaapMessageHandler getDmaapMessageHandler() { if (this.dmaapMessageHandler == null) { String agentBaseUrl = "http://localhost:" + this.localServerHttpPort; - AsyncRestClient agentClient = new AsyncRestClient(agentBaseUrl); + AsyncRestClient agentClient = + new AsyncRestClient(agentBaseUrl, this.applicationConfig.getWebClientConfig()); AsyncRestClient producer = new AsyncRestClient(this.applicationConfig.getDmaapProducerTopicUrl(), this.applicationConfig.getWebClientConfig()); this.dmaapMessageHandler = new DmaapMessageHandler(producer, agentClient);