summaryrefslogtreecommitdiffstats
path: root/rest-services/dmaap-client
diff options
context:
space:
mode:
authorMarcin Migdal <marcin.migdal@nokia.com>2019-02-26 16:04:55 +0100
committerMarcin Migdal <marcin.migdal@nokia.com>2019-02-27 14:04:31 +0100
commitc5bc0a8afaa23c3732c25f1b3996dc2ace71fe82 (patch)
tree26a25485a1ddd8d81a1659bea1346a6d3dc0be87 /rest-services/dmaap-client
parentbc386bcf22a1078a9e29db3faff63667a3b5c99d (diff)
Remove Spring stuff from DMaaP
Change-Id: I68f4e1f398505b94053acb0999450b67906029b4 Issue-ID: DCAEGEN2-1245 Signed-off-by: Marcin Migdal <marcin.migdal@nokia.com>
Diffstat (limited to 'rest-services/dmaap-client')
-rw-r--r--rest-services/dmaap-client/pom.xml2
-rw-r--r--rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClient.java13
2 files changed, 9 insertions, 6 deletions
diff --git a/rest-services/dmaap-client/pom.xml b/rest-services/dmaap-client/pom.xml
index b378d558..598913ed 100644
--- a/rest-services/dmaap-client/pom.xml
+++ b/rest-services/dmaap-client/pom.xml
@@ -23,7 +23,7 @@
<dependency>
<groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId>
<artifactId>common-dependency</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
diff --git a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClient.java b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClient.java
index c6ac05bd..d92aef9c 100644
--- a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClient.java
+++ b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClient.java
@@ -28,17 +28,19 @@ import java.net.URI;
import java.util.UUID;
import java.util.function.Consumer;
import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.config.DmaapConsumerConfiguration;
+import org.onap.dcaegen2.services.sdk.rest.services.uri.URI.URIBuilder;
import org.slf4j.MDC;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.client.WebClient;
-import org.springframework.web.util.DefaultUriBuilderFactory;
import reactor.core.publisher.Mono;
+
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 6/26/18
*/
public class DMaaPConsumerReactiveHttpClient {
+
private final String dmaapHostName;
private final String dmaapProtocol;
private final Integer dmaapPortNumber;
@@ -47,6 +49,7 @@ public class DMaaPConsumerReactiveHttpClient {
private final String consumerId;
private final String contentType;
private final WebClient webClient;
+ private final static String SLASH="/";
/**
* Constructor of DMaaPConsumerReactiveHttpClient.
@@ -92,12 +95,12 @@ public class DMaaPConsumerReactiveHttpClient {
}
private String createRequestPath() {
- return dmaapTopicName + "/" + consumerGroup + "/" + consumerId;
+ return new StringBuilder().append(SLASH).append(dmaapTopicName).append(SLASH).append(consumerGroup).append(SLASH).append(consumerId).toString();
}
-
URI getUri() {
- return new DefaultUriBuilderFactory().builder().scheme(dmaapProtocol).host(dmaapHostName).port(dmaapPortNumber)
- .path(createRequestPath()).build();
+ return URI.create(
+ new URIBuilder().scheme(dmaapProtocol).host(dmaapHostName).port(dmaapPortNumber).path(createRequestPath())
+ .build().toString());
}
}