From 5d4f252a530a0d9abbf2a363354c5e56e8f2f33e Mon Sep 17 00:00:00 2001 From: ecaiyanlinux Date: Sat, 1 Aug 2020 22:05:35 +0200 Subject: [PATCH] Add webconfig for dmaap/rapp rest client Change-Id: I624858aa8373ffa98581706ebbce5fb5deed0e84 Signed-off-by: ecaiyanlinux --- .../src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java | 3 ++- .../main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java | 2 +- .../main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/policy-agent/src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java b/policy-agent/src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java index 3297b622..113abcb6 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java @@ -29,7 +29,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import reactor.core.publisher.Mono; - +import lombok.Getter; /** * Factory for A1 clients that supports four different protocol versions of the * A1 api. @@ -38,6 +38,7 @@ public class A1ClientFactory { private static final Logger logger = LoggerFactory.getLogger(A1ClientFactory.class); + @Getter private final ApplicationConfig appConfig; @Autowired 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..d7d50a5e 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 @@ -150,7 +150,7 @@ public class DmaapMessageConsumer { protected DmaapMessageHandler getDmaapMessageHandler() throws IOException { 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); diff --git a/policy-agent/src/main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java b/policy-agent/src/main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java index 83c64e89..6ae55c46 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java @@ -160,7 +160,7 @@ public class RicSynchronizationTask { } AsyncRestClient createNotificationClient(final String url) { - return new AsyncRestClient(url); + return new AsyncRestClient(url, this.a1ClientFactory.getAppConfig().getWebClientConfig()); } private Flux synchronizePolicyTypes(Ric ric, A1Client a1Client) { -- 2.16.6