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 2020/09/14 12:18:40 UTC

[GitHub] [rocketmq-externals] maixiaohai commented on a change in pull request #633: [ISSUE #632] Fix console UI show trace message detail return wrong

maixiaohai commented on a change in pull request #633:
URL: https://github.com/apache/rocketmq-externals/pull/633#discussion_r487866541



##########
File path: rocketmq-console/src/main/java/org/apache/rocketmq/console/service/impl/MessageTraceServiceImpl.java
##########
@@ -42,11 +42,9 @@
     @Override public List<MessageTraceView> queryMessageTraceByTopicAndKey(String topic, String key) {
         try {
             List<MessageTraceView> messageTraceViews = new ArrayList<MessageTraceView>();
-            List<MessageExt> messageTraceList = mqAdminExt.queryMessage(topic, key, QUERY_MESSAGE_MAX_NUM, 0, System.currentTimeMillis()).getMessageList();
-            for (MessageExt messageExt : messageTraceList) {
-                List<MessageTraceView> messageTraceView = MessageTraceView.decodeFromTraceTransData(key, new String(messageExt.getBody(), Charsets.UTF_8));
-                messageTraceViews.addAll(messageTraceView);
-            }
+            MessageExt messageExt = mqAdminExt.viewMessage(topic, key);

Review comment:
       QueryMessage method seems have a different parameter with ViewMessage method, and  QueryMessage need a input parameter **key**, while here we query by msgId, so always the api return "query message by key finished, but no message".
   Actually, I'm not quite sure about the difference between **key** and **msgId**, so I read the source code of **QueryMessageProcessor** class , it has two methods viewMessageById and queryMessage, queryMessage seems a kind of batch search.




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