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 75296014f7e336d8329496e0284926842018fa2a..a1b3c1a227d60e83fe2d2e45d9ff0c642313ab15 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 );