From ca7eb991c910002e2c798d29e52a812caed7729c Mon Sep 17 00:00:00 2001 From: Victor Gao Date: Sat, 26 May 2018 20:35:45 +0800 Subject: [PATCH] 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 --- .../src/main/java/org/onap/holmes/common/dmaap/Publisher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.16.6