summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src
diff options
context:
space:
mode:
authorVictor Gao <victor.gao@huawei.com>2018-05-26 20:35:45 +0800
committerJessica Wagantall <jwagantall@linuxfoundation.org>2018-05-30 17:51:34 +0000
commitca7eb991c910002e2c798d29e52a812caed7729c (patch)
treed2f3bffaa728b57dcccd6e21401dd5df3181ec28 /holmes-actions/src
parentb6920b68810a4679257ed72437dd7152a0b291d0 (diff)
Fix case sensitive issue in msg body
Use Gson().toJson function to convert the content string. Change-Id: Id5480b9c9c5e8830f3c4606b551de6338ed88551 Issue-ID: HOLMES-135 Signed-off-by: Victor Gao <victor.gao@huawei.com>
Diffstat (limited to 'holmes-actions/src')
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java
index b3a9214..09bb013 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java
@@ -23,6 +23,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.onap.holmes.common.dmaap.entity.PolicyMsg;
import org.onap.holmes.common.exception.CorrelationException;
import com.alibaba.fastjson.JSON;
+import com.google.gson.Gson;
import java.util.HashMap;
import javax.ws.rs.core.MediaType;
import lombok.Getter;
@@ -47,7 +48,8 @@ public class Publisher {
public boolean publish(PolicyMsg msg) throws CorrelationException {
String content;
try {
- content = JSON.toJSONString(msg);
+ //content = JSON.toJSONString(msg);
+ content = new Gson().toJson(msg);
} catch (Exception e) {
throw new CorrelationException("Failed to convert the message object to a json string.",
e);