liuxuzxx commented on issue #3369: URL: https://github.com/apache/rocketmq/issues/3369#issuecomment-926309385
> 感谢@liuxuzxx 对这个问题的“不一不孬“,非常棒~这个问题目前只能Go兼容下这个非标的字符了,请Go客户端几位maintainer也看下该问题,后续如何改进优化? @ShannonDing @wenfengwang 看到RocketMQ相关序列化组件使用的是fastjson,去fastjson下查看了下相关的issule,例如这个:https://github.com/alibaba/fastjson/issues/3821 但是好像作者并没有回应这个问题也没有关闭,不知道这个是不是fastjson的一个问题,fastjson在Map<Integer,xxx> 这种形式的序列化确实会存在不符合json规范定义的情况(目前搜索到的json规范定义要求key是string类型),也看到讨论的issule,但是作者好像没有做回复,目前找到一种方案如下: ```java //序列化的时候,增加SerializerFeature配置,这样子数字key就会加上双引号了 String temp = JSON.toJSONString(result, SerializerFeature.WriteNonStringKeyAsString); ``` 不知道rocketmq要是这样子修改会有多大改动,只是感觉现在的这个json形式不符合规范! -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
