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 2022/06/22 06:34:17 UTC

[GitHub] [rocketmq-client-cpp] ifplusor commented on a diff in pull request #403: make the json format of ConsumeRunningInfo and HeartBeatData compatible with RocketMQ Java main project

ifplusor commented on code in PR #403:
URL: https://github.com/apache/rocketmq-client-cpp/pull/403#discussion_r903333433


##########
src/protocol/ConsumerRunningInfo.cpp:
##########
@@ -104,16 +104,18 @@ string ConsumerRunningInfo::encode() {
   Json::FastWriter fastwrite;
   string finals = fastwrite.write(root);
   string key = "\"mqTable\":";
-  key.append("{");
+  key.append("[");
   for (map<MessageQueue, ProcessQueueInfo>::iterator it = mqTable.begin(); it != mqTable.end(); ++it) {
+    key.append("[");
     key.append((it->first).toJson().toStyledString());
     key.erase(key.end() - 1);
-    key.append(":");
+    key.append(",");
     key.append((it->second).toJson().toStyledString());
+    key.append("]");
     key.append(",");
   }
   key.erase(key.end() - 1);
-  key.append("}");
+  key.append("]");

Review Comment:
   The type of `mqTable` in Java is `TreeMap<MessageQueue, ProcessQueueInfo>`, but you marshall it to a list, how does it work?



-- 
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