Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Apache RocketMQ
Rocketmq
提交
7755aaa2
R
Rocketmq
项目概览
Apache RocketMQ
/
Rocketmq
上一次同步 大约 3 年
通知
266
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看板
未验证
提交
7755aaa2
编写于
10月 07, 2021
作者:
youlixishia
提交者:
GitHub
10月 07, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3039 from Aaron-He/dev20210623
[ISSUE #2962] Implement DefaultMQAdminExt::examineTopicConfig function
上级
94a527c3
e6768baa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
4 deletion
+21
-4
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
...va/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
+1
-1
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
...rg/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
+3
-2
tools/src/main/java/org/apache/rocketmq/tools/admin/MQAdminExt.java
...main/java/org/apache/rocketmq/tools/admin/MQAdminExt.java
+1
-1
tools/src/test/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtTest.java
...rg/apache/rocketmq/tools/admin/DefaultMQAdminExtTest.java
+16
-0
未找到文件。
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
浏览文件 @
7755aaa2
...
...
@@ -209,7 +209,7 @@ public class DefaultMQAdminExt extends ClientConfig implements MQAdminExt {
}
@Override
public
TopicConfig
examineTopicConfig
(
String
addr
,
String
topic
)
{
public
TopicConfig
examineTopicConfig
(
String
addr
,
String
topic
)
throws
RemotingException
,
InterruptedException
,
MQBrokerException
{
return
defaultMQAdminExtImpl
.
examineTopicConfig
(
addr
,
topic
);
}
...
...
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
浏览文件 @
7755aaa2
...
...
@@ -224,8 +224,9 @@ public class DefaultMQAdminExtImpl implements MQAdminExt, MQAdminExtInner {
}
@Override
public
TopicConfig
examineTopicConfig
(
String
addr
,
String
topic
)
{
return
null
;
public
TopicConfig
examineTopicConfig
(
String
addr
,
String
topic
)
throws
RemotingException
,
InterruptedException
,
MQBrokerException
{
TopicConfigSerializeWrapper
topicConfigSerializeWrapper
=
this
.
mqClientInstance
.
getMQClientAPIImpl
().
getAllTopicConfig
(
addr
,
timeoutMillis
);
return
topicConfigSerializeWrapper
.
getTopicConfigTable
().
get
(
topic
);
}
@Override
...
...
tools/src/main/java/org/apache/rocketmq/tools/admin/MQAdminExt.java
浏览文件 @
7755aaa2
...
...
@@ -92,7 +92,7 @@ public interface MQAdminExt extends MQAdmin {
SubscriptionGroupConfig
examineSubscriptionGroupConfig
(
final
String
addr
,
final
String
group
)
throws
InterruptedException
,
RemotingException
,
MQClientException
,
MQBrokerException
;
TopicConfig
examineTopicConfig
(
final
String
addr
,
final
String
topic
);
TopicConfig
examineTopicConfig
(
final
String
addr
,
final
String
topic
)
throws
RemotingException
,
InterruptedException
,
MQBrokerException
;
TopicStatsTable
examineTopicStats
(
final
String
topic
)
throws
RemotingException
,
MQClientException
,
InterruptedException
,
...
...
tools/src/test/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtTest.java
浏览文件 @
7755aaa2
...
...
@@ -34,6 +34,7 @@ import org.apache.rocketmq.client.exception.MQClientException;
import
org.apache.rocketmq.client.impl.MQClientAPIImpl
;
import
org.apache.rocketmq.client.impl.MQClientManager
;
import
org.apache.rocketmq.client.impl.factory.MQClientInstance
;
import
org.apache.rocketmq.common.TopicConfig
;
import
org.apache.rocketmq.common.admin.ConsumeStats
;
import
org.apache.rocketmq.common.admin.OffsetWrapper
;
import
org.apache.rocketmq.common.admin.TopicOffset
;
...
...
@@ -54,6 +55,7 @@ import org.apache.rocketmq.common.protocol.body.ProcessQueueInfo;
import
org.apache.rocketmq.common.protocol.body.ProducerConnection
;
import
org.apache.rocketmq.common.protocol.body.QueueTimeSpan
;
import
org.apache.rocketmq.common.protocol.body.SubscriptionGroupWrapper
;
import
org.apache.rocketmq.common.protocol.body.TopicConfigSerializeWrapper
;
import
org.apache.rocketmq.common.protocol.body.TopicList
;
import
org.apache.rocketmq.common.protocol.heartbeat.ConsumeType
;
import
org.apache.rocketmq.common.protocol.heartbeat.MessageModel
;
...
...
@@ -226,6 +228,14 @@ public class DefaultMQAdminExtTest {
consumerRunningInfo
.
setStatusTable
(
new
TreeMap
<
String
,
ConsumeStatus
>());
consumerRunningInfo
.
setSubscriptionSet
(
new
TreeSet
<
SubscriptionData
>());
when
(
mQClientAPIImpl
.
getConsumerRunningInfo
(
anyString
(),
anyString
(),
anyString
(),
anyBoolean
(),
anyLong
())).
thenReturn
(
consumerRunningInfo
);
TopicConfigSerializeWrapper
topicConfigSerializeWrapper
=
new
TopicConfigSerializeWrapper
();
topicConfigSerializeWrapper
.
setTopicConfigTable
(
new
ConcurrentHashMap
<
String
,
TopicConfig
>()
{
{
put
(
"topic_test_examine_topicConfig"
,
new
TopicConfig
(
"topic_test_examine_topicConfig"
));
}
});
when
(
mQClientAPIImpl
.
getAllTopicConfig
(
anyString
(),
anyLong
())).
thenReturn
(
topicConfigSerializeWrapper
);
}
@AfterClass
...
...
@@ -413,4 +423,10 @@ public class DefaultMQAdminExtTest {
assertThat
(
subscriptionGroupWrapper
.
getSubscriptionGroupTable
().
get
(
"Consumer-group-one"
).
getGroupName
()).
isEqualTo
(
"Consumer-group-one"
);
assertThat
(
subscriptionGroupWrapper
.
getSubscriptionGroupTable
().
get
(
"Consumer-group-one"
).
isConsumeBroadcastEnable
()).
isTrue
();
}
@Test
public
void
testExamineTopicConfig
()
throws
MQBrokerException
,
RemotingException
,
InterruptedException
{
TopicConfig
topicConfig
=
defaultMQAdminExt
.
examineTopicConfig
(
"127.0.0.1:10911"
,
"topic_test_examine_topicConfig"
);
assertThat
(
topicConfig
.
getTopicName
().
equals
(
"topic_test_examine_topicConfig"
));
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录