From: Victor Gao Date: Sat, 26 May 2018 12:35:45 +0000 (+0800) Subject: Fix case sensitive issue in msg body X-Git-Tag: 1.2.0~17 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=holmes%2Fcommon.git;a=commitdiff_plain;h=ca7eb991c910002e2c798d29e52a812caed7729c 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 --- 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);