diff options
author | 2018-05-26 20:35:45 +0800 | |
---|---|---|
committer | 2018-05-30 17:51:34 +0000 | |
commit | ca7eb991c910002e2c798d29e52a812caed7729c (patch) | |
tree | d2f3bffaa728b57dcccd6e21401dd5df3181ec28 /holmes-actions/src/main/java/org/onap | |
parent | b6920b68810a4679257ed72437dd7152a0b291d0 (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/main/java/org/onap')
-rw-r--r-- | holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java | 4 |
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);
|