Skip to content

Commit c264de9

Browse files
committed
Format output
1 parent 0499586 commit c264de9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) t
129129
diffTotal += diff;
130130
String lastTime = "";
131131
try {
132-
lastTime = UtilAll.formatDate(new Date(offsetWrapper.getLastTimestamp()), UtilAll.YYYY_MM_DD_HH_MM_SS);
132+
if (offsetWrapper.getLastTimestamp() == 0) {
133+
lastTime = "N/A";
134+
} else {
135+
lastTime = UtilAll.formatDate(new Date(offsetWrapper.getLastTimestamp()), UtilAll.YYYY_MM_DD_HH_MM_SS);
136+
}
133137
} catch (Exception e) {
134138
}
135139

@@ -144,7 +148,7 @@ public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) t
144148
mq.getQueueId(),
145149
offsetWrapper.getBrokerOffset(),
146150
offsetWrapper.getConsumerOffset(),
147-
null != clientIP ? clientIP : "NA",
151+
null != clientIP ? clientIP : "N/A",
148152
diff,
149153
lastTime
150154
);

0 commit comments

Comments
 (0)