summaryrefslogtreecommitdiffstats
path: root/dmaap-dsa/src
diff options
context:
space:
mode:
authorShiwei Tian <tian.shiwei@zte.com.cn>2017-10-20 09:23:34 +0800
committerShiwei Tian <tian.shiwei@zte.com.cn>2017-10-20 09:23:58 +0800
commit7f217967fd086a172d89bfb7db21160b4a895504 (patch)
treec68046b8a70cab7a83a3eabd01f3ef71d25af5e5 /dmaap-dsa/src
parentbca100aebd44842fc640f2005d6da22c7ee4a4ff (diff)
modify bug
Issue-ID: HOLMES-71 Change-Id: I8511279d7a2b0c23bc036bb95449c34aee3be643 Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
Diffstat (limited to 'dmaap-dsa/src')
-rw-r--r--dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java b/dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java
index 55b7558..572872b 100644
--- a/dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java
+++ b/dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java
@@ -19,7 +19,6 @@ package org.onap.holmes.dsa.dmaappolling;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import javax.inject.Inject;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
@@ -28,14 +27,15 @@ import lombok.Getter;
import lombok.Setter;
import org.glassfish.jersey.client.ClientConfig;
import org.onap.holmes.common.api.stat.VesAlarm;
+import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;
import org.onap.holmes.common.exception.CorrelationException;
@Getter
@Setter
public class Subscriber {
- @Inject
- private DMaaPResponseUtil dMaaPResponseUtil;
+ private DMaaPResponseUtil dMaaPResponseUtil = ServiceLocatorHolder.getLocator()
+ .getService(DMaaPResponseUtil.class);
/**
* The number of milliseconds to wait for messages if none are immediately available. This
@@ -67,7 +67,7 @@ public class Subscriber {
try {
response = getDMaaPData();
} catch (Exception e) {
- throw new CorrelationException("Failed to connect to DMapp.", e);
+ throw new CorrelationException("Failed to get DMapp data.", e);
}
try {
return extractVesAlarm(response);
@@ -78,8 +78,8 @@ public class Subscriber {
private List<String> getDMaaPData() {
Client client = ClientBuilder.newClient(new ClientConfig());
- WebTarget webTarget = client.target(url);
- Response response = webTarget.path(topic).path(consumerGroup).path(consumer).request().get();
+ WebTarget webTarget = client.target(url + "/" + consumerGroup + "/" + consumer);
+ Response response = webTarget.request().get();
return response.readEntity(List.class);
}