Skip to content

Commit

Permalink
Optimize command line tools QueryMsgByKey& QueryMsgTraceById
Browse files Browse the repository at this point in the history
  • Loading branch information
loboxu authored and zhouxinyu committed Feb 27, 2023
1 parent 72f458b commit 473e23b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Options buildCommandlineOptions(Options options) {
opt.setRequired(false);
options.addOption(opt);

opt = new Option("num", "maxNum", true, "The maximum number of messages returned by the query, default:64");
opt = new Option("c", "maxNum", true, "The maximum number of messages returned by the query, default:64");
opt.setRequired(false);
options.addOption(opt);

Expand All @@ -83,8 +83,8 @@ public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) t
if (commandLine.hasOption("e")) {
endTimestamp = Long.parseLong(commandLine.getOptionValue("e").trim());
}
if (commandLine.hasOption("num")) {
maxNum = Integer.parseInt(commandLine.getOptionValue("num").trim());
if (commandLine.hasOption("c")) {
maxNum = Integer.parseInt(commandLine.getOptionValue("c").trim());
}
this.queryByKey(defaultMQAdminExt, topic, key, maxNum, beginTimestamp, endTimestamp);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Options buildCommandlineOptions(Options options) {
opt.setRequired(false);
options.addOption(opt);

opt = new Option("num", "maxNum", true, "The maximum number of messages returned by the query, default:64");
opt = new Option("c", "maxNum", true, "The maximum number of messages returned by the query, default:64");
opt.setRequired(false);
options.addOption(opt);

Expand Down Expand Up @@ -101,8 +101,8 @@ public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) t
if (commandLine.hasOption("e")) {
endTimestamp = Long.parseLong(commandLine.getOptionValue("e").trim());
}
if (commandLine.hasOption("num")) {
maxNum = Integer.parseInt(commandLine.getOptionValue("num").trim());
if (commandLine.hasOption("c")) {
maxNum = Integer.parseInt(commandLine.getOptionValue("c").trim());
}

this.queryTraceByMsgId(defaultMQAdminExt, traceTopic, msgId, maxNum, beginTimestamp, endTimestamp);
Expand Down

0 comments on commit 473e23b

Please sign in to comment.