zongtanghu commented on a change in pull request #1824: [ISSUE #1770] Add a
query message trace command in mqadmin.
URL: https://github.com/apache/rocketmq/pull/1824#discussion_r399054856
##########
File path:
client/src/main/java/org/apache/rocketmq/client/trace/TraceDataEncoder.java
##########
@@ -52,15 +52,16 @@
bean.setTags(line[6]);
bean.setKeys(line[7]);
bean.setStoreHost(line[8]);
- bean.setBodyLength(Integer.parseInt(line[9]));
- pubContext.setCostTime(Integer.parseInt(line[10]));
-
bean.setMsgType(MessageType.values()[Integer.parseInt(line[11])]);
+ bean.setClientHost(line[9]);
+ bean.setBodyLength(Integer.parseInt(line[10]));
+ pubContext.setCostTime(Integer.parseInt(line[11]));
+
bean.setMsgType(MessageType.values()[Integer.parseInt(line[12])]);
- if (line.length == 13) {
- pubContext.setSuccess(Boolean.parseBoolean(line[12]));
- } else if (line.length == 14) {
- bean.setOffsetMsgId(line[12]);
+ if (line.length == 14) {
pubContext.setSuccess(Boolean.parseBoolean(line[13]));
+ } else if (line.length == 15) {
+ bean.setOffsetMsgId(line[13]);
+ pubContext.setSuccess(Boolean.parseBoolean(line[14]));
Review comment:
Here, you must think of a critical compatibility problem that users depend
on the older version of rocketmq client ,such as 4.4.0 or 4.5.0, then it send
older format's message trace data, so you can add this command can't resolve
this problem.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services