Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Apache RocketMQ
Rocketmq
提交
5515791f
R
Rocketmq
项目概览
Apache RocketMQ
/
Rocketmq
上一次同步 大约 3 年
通知
267
Star
16139
Fork
68
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rocketmq
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5515791f
编写于
5月 27, 2021
作者:
Z
zhangjidi2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ISSUE #2556] The queryMsgTraceById command supports specifying the customerTraceTopic
上级
8e05485f
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
11 addition
and
3 deletion
+11
-3
tools/src/main/java/org/apache/rocketmq/tools/command/message/QueryMsgTraceByIdSubCommand.java
...mq/tools/command/message/QueryMsgTraceByIdSubCommand.java
+11
-3
未找到文件。
tools/src/main/java/org/apache/rocketmq/tools/command/message/QueryMsgTraceByIdSubCommand.java
浏览文件 @
5515791f
...
@@ -44,6 +44,10 @@ public class QueryMsgTraceByIdSubCommand implements SubCommand {
...
@@ -44,6 +44,10 @@ public class QueryMsgTraceByIdSubCommand implements SubCommand {
Option
opt
=
new
Option
(
"i"
,
"msgId"
,
true
,
"Message Id"
);
Option
opt
=
new
Option
(
"i"
,
"msgId"
,
true
,
"Message Id"
);
opt
.
setRequired
(
true
);
opt
.
setRequired
(
true
);
options
.
addOption
(
opt
);
options
.
addOption
(
opt
);
opt
=
new
Option
(
"t"
,
"traceTopic"
,
true
,
"The name value of message trace topic"
);
opt
.
setRequired
(
false
);
options
.
addOption
(
opt
);
return
options
;
return
options
;
}
}
...
@@ -63,7 +67,11 @@ public class QueryMsgTraceByIdSubCommand implements SubCommand {
...
@@ -63,7 +67,11 @@ public class QueryMsgTraceByIdSubCommand implements SubCommand {
defaultMQAdminExt
.
setInstanceName
(
Long
.
toString
(
System
.
currentTimeMillis
()));
defaultMQAdminExt
.
setInstanceName
(
Long
.
toString
(
System
.
currentTimeMillis
()));
try
{
try
{
final
String
msgId
=
commandLine
.
getOptionValue
(
'i'
).
trim
();
final
String
msgId
=
commandLine
.
getOptionValue
(
'i'
).
trim
();
this
.
queryTraceByMsgId
(
defaultMQAdminExt
,
msgId
);
String
traceTopic
=
TopicValidator
.
RMQ_SYS_TRACE_TOPIC
;
if
(
commandLine
.
hasOption
(
't'
))
{
traceTopic
=
commandLine
.
getOptionValue
(
't'
).
trim
();
}
this
.
queryTraceByMsgId
(
defaultMQAdminExt
,
traceTopic
,
msgId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
SubCommandException
(
this
.
getClass
().
getSimpleName
()
+
"command failed"
,
e
);
throw
new
SubCommandException
(
this
.
getClass
().
getSimpleName
()
+
"command failed"
,
e
);
}
finally
{
}
finally
{
...
@@ -71,10 +79,10 @@ public class QueryMsgTraceByIdSubCommand implements SubCommand {
...
@@ -71,10 +79,10 @@ public class QueryMsgTraceByIdSubCommand implements SubCommand {
}
}
}
}
private
void
queryTraceByMsgId
(
final
DefaultMQAdminExt
admin
,
String
msgId
)
private
void
queryTraceByMsgId
(
final
DefaultMQAdminExt
admin
,
String
traceTopic
,
String
msgId
)
throws
MQClientException
,
InterruptedException
{
throws
MQClientException
,
InterruptedException
{
admin
.
start
();
admin
.
start
();
QueryResult
queryResult
=
admin
.
queryMessage
(
TopicValidator
.
RMQ_SYS_TRACE_TOPIC
,
msgId
,
64
,
0
,
System
.
currentTimeMillis
());
QueryResult
queryResult
=
admin
.
queryMessage
(
traceTopic
,
msgId
,
64
,
0
,
System
.
currentTimeMillis
());
List
<
MessageExt
>
messageList
=
queryResult
.
getMessageList
();
List
<
MessageExt
>
messageList
=
queryResult
.
getMessageList
();
List
<
TraceView
>
traceViews
=
new
ArrayList
<>();
List
<
TraceView
>
traceViews
=
new
ArrayList
<>();
for
(
MessageExt
message
:
messageList
)
{
for
(
MessageExt
message
:
messageList
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录