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 2021/09/27 07:48:23 UTC

[GitHub] [rocketmq] liuxuzxx opened a new pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

liuxuzxx opened a new pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386


   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   #3369 
   
   ## Brief changelog
   
   完善rpc调用的json报文的key不符合json规范的问题
   
   ## Verifying this change
   
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r720616493



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       ok,我感觉这个最大的隐患可能是broker和namesrv是否需要同时设置SerializerFeature.WriteNonStringKeyAsString的问题,我在低版本的fastjson1.2.58好像,是必须同时设置的!如果最新版本的fastjson也需要同时设置,那就真得两边同时修改了!




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r720612937



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       总体来说,我认为这是一个bug,而不是一个优化点,因为这个json数据,go无法解析,在线测试json格式也是错误的,然后jackson也无法解析,只能是fastjson自己产生,以及解析!这是不是就有点违背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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-938319747


   > @liuxuzxx @lizhanhui depending on the client version is a good idea, but you should first modify each client to support new protocol and then you can know on what version to start using new protocol
   
   如果仅仅通过version字段搞不定,那么就使用(version+language)来唯一确定版本号的分水岭,然后在未来的某个时间点直接给全更新了!现在的问题就是设置这个分水岭版本号的问题


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] Frodez commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
Frodez commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-945776902


   > The change is not compatible for go and cpp client, So the best way is add a new version of protocol.
   
   The go and cpp client both use the standard json serializer and deserializer libraries. In fact, the go and cpp client have not implemented those complex invalid json-formatted requests and responses, so they have not faced this problem yet, but if they continue introducing new features, they will also be stuck in this problem at one day.


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] yuz10 commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
yuz10 commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-991408915


   > > The change is not compatible for go and cpp client, So the best way is add a new version of protocol.
   > 
   > The go and cpp client both use the standard json serializer and deserializer libraries. In fact, the go and cpp client have not implemented those complex invalid json-formatted requests and responses, so they have not faced this problem yet, but if they continue introducing new features, they will also be stuck in this problem at one day.
   
   I dont think so, The line https://github.com/apache/rocketmq-client-go/blob/master/internal/route.go#L533 is not compatible with standard 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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx closed pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx closed pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386


   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx closed pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx closed pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386


   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] lizhanhui commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
lizhanhui commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r720614648



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       I agree it can be safely regarded as BUG for not generating standard-conforming **JSON**. But it would be necessary not to modify global behavior without notice. Consider this scenario, an application developer uses RocketMQ client and FastJSON at the same time. If our client quietly changes the default behavior, we may break his/her application or mess his data up totally in case he/she depends on the default behavior.
   
   Further, IMO, RocketMQ-scope changes can be achieved through modifying RemotingSerializable.java#decode/encode only. 




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r723122895



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       测试了下fastjson的最新版本(1.2.76)是可以适配两种json格式的处理的,但是考虑到客户端的fastjson的版本是否也能够兼容和适配,存在风险性。
   由于存在服务模块,namesrv,broker三者之间通过rpc的方式进行交流,所以,为了兼容,我想了如下方案来处理:
   ```
   org.apache.rocketmq.remoting.protocol.RemotingCommand 这个类所有的请求命令类,在这个类里面有个属性:version,这个属性记录了当前请求的RocketMQ的版本号,那么就可以根据这个版本号来判断,toJSON()调用的时候是否需要设置:
   SerializerFeature.WriteNonStringKeyAsString 属性,具体的伪代码如下:
   
   if(version>= 设置了WriteNonStringKeyAsString版本号){
       return JSON.toJSON(obj,SerializerFeature.WriteNonStringKeyAsString);
   }else{
       return JSON.toJSON(obj);
   }
   ```
   目前我只能想到这个兼容方案了,因为,可能存在客户端,namesrv和broker以及不同的broker版本号都可能不一致的情况,所以,你之前提到的三个问题,如果是通过我这种一棍子打死的方式来处理,确实很粗暴。那么正好就利用这个version属性来做这个版本的分割线判断!




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] yuz10 commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
yuz10 commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-938316259


   @liuxuzxx @lizhanhui  depending on the client version is a good idea, but you should first modify each client to support new protocol and then you can know on what version to start using new protocol


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] lizhanhui commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
lizhanhui commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r716633768



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       Changing default behavior may bring about far-reaching impacts. It would be best to use the overloading method ```JSON.toJSONString(Object object, SerializerFeature... features)```, modifying behavior of RocketMQ-scope.




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] lizhanhui commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
lizhanhui commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r720614648



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       I agree it can be safely regarded as **A BUG** for not generating standard-conforming **JSON**. But it would be necessary not to modify global behavior without notice. Consider this scenario, an application developer uses RocketMQ client and FastJSON at the same time. If our client quietly changes the default behavior, we may break his/her application or mess his data up totally in case he/she depends on the default behavior.
   
   Further, IMO, RocketMQ-scope changes can be achieved through modifying RemotingSerializable.java#decode/encode only. 




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] lizhanhui commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
lizhanhui commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-938311272


   @liuxuzxx Is there any blocking reason to close this pull request?  I am pretty interested in this issue and willing to work collaboratively with you to resolve issues.  We can even resolve dependent issues at the first phase and eventually make RocketMQ speaks standard 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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] lizhanhui commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
lizhanhui commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-938312048


   > The change is not compatible for go and cpp client, So the best way is add a new version of protocol.
   
   @yuz10 We can definitely avoid issues at the design/protocol layer. But this issue is not a design issue. It is an implementation choice made without keeping JSON standards in mind. 


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r720611791



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       fastjson默认生成的key会产生不规范情况,如果只是重载方法,那样子就需要修改很多可能不规范的地方的调用,然后,改动量很大!现在只需要加这一个序列化属性,让rocketmq的所有remote调用结果全部是合法的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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] lizhanhui commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
lizhanhui commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r720615560



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       Before modifying the behavior, we have to:
   1, Make sure code can correctly deserialize JSON strings previously serialized without Compatible Feature configured;
   2, Make sure clients without feature configured may compatibly parse standard JSON;
   3, Verify JSON generated with feature configured can serialize and deserialize complex objects, say a map with non-string key.
   
   Once these three compatible concerns are resolved, I am glad to +1 for this pull request.




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r720612184



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       这个我已经测试过了,这个remote模块会被admin和client都包含,所以这样子也能做到服务端和客户端的序列化属性的一致性,要不然可能会产生客户端和服务端的序列化属性不一致的情况!




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] lizhanhui commented on a change in pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
lizhanhui commented on a change in pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#discussion_r721059801



##########
File path: remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingSerializable.java
##########
@@ -17,11 +17,17 @@
 package org.apache.rocketmq.remoting.protocol;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
 import java.nio.charset.Charset;
 
 public abstract class RemotingSerializable {
     private final static Charset CHARSET_UTF8 = Charset.forName("UTF-8");
 
+    static {

Review comment:
       I suggest we adopt a test-driven development strategy for this issue.  Create 3 or more unit tests, which help us guarantee changes are always compatible with the community and discuss potential solutions where issues show up.




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx closed pull request #3386: Feature/enhancement fix irrlegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx closed pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386


   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-938313080


   > @liuxuzxx Is there any blocking reason to close this pull request? I am pretty interested in this issue and willing to work collaboratively with you to resolve issues. We can even resolve dependent issues at the first phase and eventually make RocketMQ speaks standard JSON.
   
   主要是现在,我想到的方案就是通过这个version进行判断,来做兼容,但是这个实行起来,我需要获取在哪个version开始做转换,所以,现在是遇到了这个问题!


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] liuxuzxx commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
liuxuzxx commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-938313563


   > > @liuxuzxx Is there any blocking reason to close this pull request? I am pretty interested in this issue and willing to work collaboratively with you to resolve issues. We can even resolve dependent issues at the first phase and eventually make RocketMQ speaks standard JSON.
   > 
   > 主要是现在,我想到的方案就是通过这个version进行判断,来做兼容,但是这个实行起来,我需要获取在哪个version开始做转换,所以,现在是遇到了这个问题!
   
   后来,我想了下,我只是go解析这个非规范的json的问题,我后续查看下是否可以通过go调用js引擎来半自动处理这个非法的json数据,有人建议修改go解析json的代码,不过我觉得太过于麻烦了,所以暂时看下是否能通过go调用js的引擎来处理下!


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] yuz10 commented on pull request #3386: [ISSUE #3369]Feature/enhancement fix illegal json by fastjson lx

Posted by GitBox <gi...@apache.org>.
yuz10 commented on pull request #3386:
URL: https://github.com/apache/rocketmq/pull/3386#issuecomment-991408915


   > > The change is not compatible for go and cpp client, So the best way is add a new version of protocol.
   > 
   > The go and cpp client both use the standard json serializer and deserializer libraries. In fact, the go and cpp client have not implemented those complex invalid json-formatted requests and responses, so they have not faced this problem yet, but if they continue introducing new features, they will also be stuck in this problem at one day.
   
   I dont think so, The line https://github.com/apache/rocketmq-client-go/blob/master/internal/route.go#L533 is not compatible with standard 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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org