summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 778a77b80..dd59f5868 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;
}