aboutsummaryrefslogtreecommitdiffstats
path: root/dcae-analytics-common/src/main/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilter.java
diff options
context:
space:
mode:
Diffstat (limited to 'dcae-analytics-common/src/main/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilter.java')
-rw-r--r--dcae-analytics-common/src/main/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilter.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/dcae-analytics-common/src/main/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilter.java b/dcae-analytics-common/src/main/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilter.java
index 54de5cc..38e8d28 100644
--- a/dcae-analytics-common/src/main/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilter.java
+++ b/dcae-analytics-common/src/main/java/org/openecomp/dcae/apod/analytics/common/service/filter/GenericJsonMessageFilter.java
@@ -29,6 +29,7 @@ import org.openecomp.dcae.apod.analytics.common.service.processor.AbstractMessag
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.List;
import java.util.Set;
/**
@@ -77,7 +78,9 @@ public class GenericJsonMessageFilter extends AbstractMessageProcessor<JsonMessa
final DocumentContext documentContext = JsonPath.parse(jsonMessage);
String jsonPathValue = null;
try {
- jsonPathValue = documentContext.read(jsonPath, String.class);
+ final List jsonPathValues = documentContext.read(jsonPath);
+ final Object pathValue = jsonPathValues.isEmpty() ? null : jsonPathValues.get(0);
+ jsonPathValue = pathValue instanceof Number ? pathValue.toString() : (String) pathValue;
} catch (PathNotFoundException ex) {
LOG.info("Unable to find json Path: {}. Exception: {}, Json Message: {}", jsonPath, ex, jsonMessage);
}