From fc3fb2fdbe1d3c34299eb209e71d8f8aae54962e Mon Sep 17 00:00:00 2001 From: rongtong Date: Thu, 27 Feb 2020 20:15:56 +0800 Subject: [PATCH] [ISSUE #1787] Fix the issue that queryCq command of mqadmin returned incorrect data (#1793) * fix(tools):fix the issue that queryCq command of mqadmin returned incorrect data * fix(mqadmin):set status code in advance in queryConsumeQueue method --- .../rocketmq/broker/processor/AdminBrokerProcessor.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java index b2edc1a2..2b077cbb 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java @@ -1493,11 +1493,9 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { response.setRemark(String.format("%d@%s is not exist!", requestHeader.getQueueId(), requestHeader.getTopic())); return response; } - - QueryConsumeQueueResponseBody body = new QueryConsumeQueueResponseBody(); response.setCode(ResponseCode.SUCCESS); - response.setBody(body.encode()); + QueryConsumeQueueResponseBody body = new QueryConsumeQueueResponseBody(); body.setMaxQueueIndex(consumeQueue.getMaxOffsetInQueue()); body.setMinQueueIndex(consumeQueue.getMinOffsetInQueue()); @@ -1556,7 +1554,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { } finally { result.release(); } - + response.setBody(body.encode()); return response; } -- GitLab