You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/10/07 10:28:51 UTC

[GitHub] [rocketmq] lizhanhui opened a new issue #1506: RocketMQ is producing non-standard-compliant JSON

lizhanhui opened a new issue #1506: RocketMQ is producing non-standard-compliant JSON
URL: https://github.com/apache/rocketmq/issues/1506
 
 
   RocketMQ uses [fastjson](https://github.com/alibaba/fastjson) to serialize object to JSON text.
   Unfortunately, with the default configuration, the FastJson library does not respect the JSON standard as expected, which imposes an enormous obstacle for other languages to talk to RocketMQ.
   
   For example, 
   ```java
           Map<Integer, String> map = new HashMap<Integer, String>();
           map.put(1, "abc");
           map.put(2, "def");
           System.out.println(RemotingSerializable.toJson(map, false));
   ```
   generates
   ```text
   {1:"abc",2:"def"}
   ```
   which does not comply with the JSON standard and may be validated in [JSON Lint](https://jsonlint.com/).
   
   non-standard-compliant JSON can not be parsed by many JSON libraries, say JsonCpp, RapidJson, etc.  It's mandatory to fix this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services