From fa4c07f68be40b8adf62f0bf230c169f6ad0e2f6 Mon Sep 17 00:00:00 2001 From: Marcin Migdal Date: Wed, 27 Mar 2019 13:38:53 +0100 Subject: Support "Empty" from DMaap Simulator Change-Id: Idaf9f5df34017aad6c7f2a3aa1e65b971ff5d5bc Issue-ID: DCAEGEN2-1361 Signed-off-by: Marcin Migdal --- .../onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'prh-app-server/src/main/java') diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java index d9a673ca..531a8e5f 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java @@ -24,6 +24,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import com.google.gson.JsonPrimitive; import org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException; import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel; import org.onap.dcaegen2.services.prh.model.ImmutableConsumerDmaapModel; @@ -87,6 +88,11 @@ public class DmaapConsumerJsonParser { LOGGER.debug("DmaapConsumerJsonParser input for parsing: {}",jsonElement); + if(jsonElement instanceof JsonPrimitive) { + LOGGER.debug("Response from DMaaP is Json primitive {}", jsonElement); + return Flux.empty(); + } + if(jsonElement instanceof JsonObject) return create(Flux.just((JsonObject) jsonElement)); -- cgit 1.2.3-korg