summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main/java
diff options
context:
space:
mode:
authorMarcin Migdal <marcin.migdal@nokia.com>2019-03-27 13:38:53 +0100
committerMarcin Migdal <marcin.migdal@nokia.com>2019-03-27 13:38:53 +0100
commitfa4c07f68be40b8adf62f0bf230c169f6ad0e2f6 (patch)
tree351fa565bd725e275fc15323adad8ed8c4af42f0 /prh-app-server/src/main/java
parent2647dd6e2451dab9f758034c9189271c40ecf600 (diff)
Support "Empty" from DMaap Simulator
Change-Id: Idaf9f5df34017aad6c7f2a3aa1e65b971ff5d5bc Issue-ID: DCAEGEN2-1361 Signed-off-by: Marcin Migdal <marcin.migdal@nokia.com>
Diffstat (limited to 'prh-app-server/src/main/java')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java6
1 files changed, 6 insertions, 0 deletions
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));