You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by vo...@apache.org on 2022/01/06 01:34:50 UTC

[rocketmq] branch develop updated: [ISSUE #3696]Optimize the query consumer connection display (#3697)

This is an automated email from the ASF dual-hosted git repository.

vongosling pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 0ceb9e6  [ISSUE #3696]Optimize the query consumer connection display (#3697)
0ceb9e6 is described below

commit 0ceb9e6ceb761cc26d26fae3f8818fe03ddf0769
Author: zhangjidi2016 <10...@qq.com>
AuthorDate: Thu Jan 6 09:34:33 2022 +0800

    [ISSUE #3696]Optimize the query consumer connection display (#3697)
---
 .../command/connection/ConsumerConnectionSubCommand.java   | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/connection/ConsumerConnectionSubCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/connection/ConsumerConnectionSubCommand.java
index 4e53caf..1276712 100644
--- a/tools/src/main/java/org/apache/rocketmq/tools/command/connection/ConsumerConnectionSubCommand.java
+++ b/tools/src/main/java/org/apache/rocketmq/tools/command/connection/ConsumerConnectionSubCommand.java
@@ -64,10 +64,9 @@ public class ConsumerConnectionSubCommand implements SubCommand {
 
             ConsumerConnection cc = defaultMQAdminExt.examineConsumerConnectionInfo(group);
 
-            int i = 1;
+            System.out.printf("%-36s %-22s %-10s %s%n", "#ClientId", "#ClientAddr", "#Language", "#Version");
             for (Connection conn : cc.getConnectionSet()) {
-                System.out.printf("%03d  %-32s %-22s %-8s %s%n",
-                    i++,
+                System.out.printf("%-36s %-22s %-10s %s%n",
                     conn.getClientId(),
                     conn.getClientAddr(),
                     conn.getLanguage(),
@@ -75,20 +74,19 @@ public class ConsumerConnectionSubCommand implements SubCommand {
                 );
             }
 
-            System.out.printf("%nBelow is subscription:");
+            System.out.printf("%nBelow is subscription:\n");
             Iterator<Entry<String, SubscriptionData>> it = cc.getSubscriptionTable().entrySet().iterator();
-            i = 1;
+            System.out.printf("%-20s %s%n", "#Topic", "#SubExpression");
             while (it.hasNext()) {
                 Entry<String, SubscriptionData> entry = it.next();
                 SubscriptionData sd = entry.getValue();
-                System.out.printf("%03d  Topic: %-40s SubExpression: %s%n",
-                    i++,
+                System.out.printf("%-20s %s%n",
                     sd.getTopic(),
                     sd.getSubString()
                 );
             }
 
-            System.out.printf("");
+            System.out.printf("\n");
             System.out.printf("ConsumeType: %s%n", cc.getConsumeType());
             System.out.printf("MessageModel: %s%n", cc.getMessageModel());
             System.out.printf("ConsumeFromWhere: %s%n", cc.getConsumeFromWhere());