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=d2daead27c772da09f3b7f80ea3de5a2b4c730f8;hb=14accd2e91460d1651fe2c228fe1ba964cbfb6a6;hp=91f9ff22bfe049b582028e5cb3da1067eace8478;hpb=89e139b32a18dfffe03a25107584e9d9cfa59fda;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 91f9ff22..d2daead2 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 @@ -2,7 +2,7 @@ * ========================LICENSE_START================================= * O-RAN-SC * %% - * Copyright (C) 2019 Nordix Foundation + * Copyright (C) 2020 Nordix Foundation * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package org.oransc.policyagent.dmaap; import com.google.common.collect.Iterables; -import java.io.FileNotFoundException; import java.io.IOException; import java.time.Duration; import java.util.Properties; @@ -83,7 +82,7 @@ public class DmaapMessageConsumer implements Runnable { } } - private Iterable fetchAllMessages() throws ServiceException, FileNotFoundException, IOException { + private Iterable fetchAllMessages() throws ServiceException, IOException { Properties dmaapConsumerProperties = this.applicationConfig.getDmaapConsumerConfig(); MRConsumer consumer = MRClientFactory.createConsumer(dmaapConsumerProperties); MRConsumerResponse response = consumer.fetchWithReturnConsumerResponse(); @@ -95,18 +94,18 @@ public class DmaapMessageConsumer implements Runnable { } } - private void processMsg(String msg) throws Exception { + private void processMsg(String msg) throws IOException { logger.debug("Message Reveived from DMAAP : {}", msg); createDmaapMessageHandler().handleDmaapMsg(msg); } - private DmaapMessageHandler createDmaapMessageHandler() throws FileNotFoundException, IOException { + private DmaapMessageHandler createDmaapMessageHandler() throws IOException { String agentBaseUrl = "http://localhost:" + this.localServerPort; AsyncRestClient agentClient = new AsyncRestClient(agentBaseUrl); Properties dmaapPublisherProperties = applicationConfig.getDmaapPublisherConfig(); MRBatchingPublisher producer = MRClientFactory.createBatchingPublisher(dmaapPublisherProperties); - return new DmaapMessageHandler(producer, this.applicationConfig, agentClient); + return new DmaapMessageHandler(producer, agentClient); } private boolean sleep(Duration duration) {