You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2018/05/22 12:12:14 UTC

[rocketmq] branch develop updated: Format output

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

lizhanhui 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 4a4a821  Format output
4a4a821 is described below

commit 4a4a821fac92f174fd7d22ee1d9079500fbd16a3
Author: shutian.lzh <sh...@alibaba-inc.com>
AuthorDate: Tue May 22 20:12:00 2018 +0800

    Format output
---
 .../tools/command/consumer/ConsumerProgressSubCommand.java        | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java
index 7529601..a1b3c1a 100644
--- a/tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java
+++ b/tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java
@@ -129,7 +129,11 @@ public class ConsumerProgressSubCommand implements SubCommand {
                     diffTotal += diff;
                     String lastTime = "";
                     try {
-                        lastTime = UtilAll.formatDate(new Date(offsetWrapper.getLastTimestamp()), UtilAll.YYYY_MM_DD_HH_MM_SS);
+                        if (offsetWrapper.getLastTimestamp() == 0) {
+                            lastTime = "N/A";
+                        } else {
+                            lastTime = UtilAll.formatDate(new Date(offsetWrapper.getLastTimestamp()), UtilAll.YYYY_MM_DD_HH_MM_SS);
+                        }
                     } catch (Exception e) {
                     }
 
@@ -144,7 +148,7 @@ public class ConsumerProgressSubCommand implements SubCommand {
                         mq.getQueueId(),
                         offsetWrapper.getBrokerOffset(),
                         offsetWrapper.getConsumerOffset(),
-                        null != clientIP ? clientIP : "NA",
+                        null != clientIP ? clientIP : "N/A",
                         diff,
                         lastTime
                     );

-- 
To stop receiving notification emails like this one, please contact
lizhanhui@apache.org.