summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-12-17 15:47:54 +0000
committerGerrit Code Review <gerrit@onap.org>2019-12-17 15:47:54 +0000
commita5f02d8bfcc832d905b480942f61cde6ced57dac (patch)
treeff7d49ec5fbf8522f6a78e92b71f40f0c3f382af
parent893680f892ab0dc6871c35cdf21af1da2d38edf2 (diff)
parentfff922790262500c1cced5e674179bf8873acb83 (diff)
Merge "Bug fix in DMAAP listener for A1 Adapter"
-rw-r--r--dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java
index 778a77b8..dd59f586 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/A1AdapterPolicyDmaapConsumer.java
@@ -34,6 +34,9 @@ public class A1AdapterPolicyDmaapConsumer extends SdncDmaapConsumerImpl {
private static final String BODY = "body";
private static final String RPC = "rpc-name";
+ private static final String INPUT = "input";
+ private static final String PAYLOAD = "Payload";
+
@Override
public void processMsg(String msg) throws InvalidMessageException {
@@ -55,13 +58,26 @@ public class A1AdapterPolicyDmaapConsumer extends SdncDmaapConsumerImpl {
LOG.warn("Missing body in A1-ADAPTER-DMAAP message");
return;
}
+
+ JsonNode input = bodyNode.get(INPUT);
+ if(input == null) {
+ LOG.info("Missing input node.");
+ return;
+ }
+
+ JsonNode payloadNode = input.get(PAYLOAD);
+ if(payloadNode == null) {
+ LOG.info("Missing payload node.");
+ return;
+ }
+
String rpcMsgbody;
try {
ObjectMapper mapper = new ObjectMapper();
- rpcMsgbody = mapper.writeValueAsString(bodyNode);
+ rpcMsgbody = mapper.writeValueAsString(payloadNode);
} catch (Exception e) {
- LOG.error("Unable to parse body in A1-ADAPTER-DMAAP message", e);
+ LOG.error("Unable to parse payload in A1-ADAPTER-DMAAP message", e);
return;
}