/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rocketmq.console.service.client;
import com.google.common.base.Throwables;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.apache.rocketmq.client.QueryResult;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.impl.MQAdminImpl;
import org.apache.rocketmq.common.AclConfig;
import org.apache.rocketmq.common.PlainAccessConfig;
import org.apache.rocketmq.common.TopicConfig;
import org.apache.rocketmq.common.admin.ConsumeStats;
import org.apache.rocketmq.common.admin.RollbackStats;
import org.apache.rocketmq.common.admin.TopicStatsTable;
import org.apache.rocketmq.common.message.MessageClientIDSetter;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.common.protocol.RequestCode;
import org.apache.rocketmq.common.protocol.ResponseCode;
import org.apache.rocketmq.common.protocol.body.BrokerStatsData;
import org.apache.rocketmq.common.protocol.body.ClusterAclVersionInfo;
import org.apache.rocketmq.common.protocol.body.ClusterInfo;
import org.apache.rocketmq.common.protocol.body.ConsumeMessageDirectlyResult;
import org.apache.rocketmq.common.protocol.body.ConsumeStatsList;
import org.apache.rocketmq.common.protocol.body.ConsumerConnection;
import org.apache.rocketmq.common.protocol.body.ConsumerRunningInfo;
import org.apache.rocketmq.common.protocol.body.GroupList;
import org.apache.rocketmq.common.protocol.body.KVTable;
import org.apache.rocketmq.common.protocol.body.ProducerConnection;
import org.apache.rocketmq.common.protocol.body.QueryConsumeQueueResponseBody;
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.route.TopicRouteData;
import org.apache.rocketmq.common.subscription.SubscriptionGroupConfig;
import org.apache.rocketmq.console.util.JsonUtil;
import org.apache.rocketmq.remoting.RemotingClient;
import org.apache.rocketmq.remoting.exception.RemotingCommandException;
import org.apache.rocketmq.remoting.exception.RemotingConnectException;
import org.apache.rocketmq.remoting.exception.RemotingException;
import org.apache.rocketmq.remoting.exception.RemotingSendRequestException;
import org.apache.rocketmq.remoting.exception.RemotingTimeoutException;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;
import org.apache.rocketmq.tools.admin.MQAdminExt;
import org.apache.rocketmq.tools.admin.api.MessageTrack;
import org.joor.Reflect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import static org.apache.rocketmq.remoting.protocol.RemotingSerializable.decode;
@Service
public class MQAdminExtImpl implements MQAdminExt {
private Logger logger = LoggerFactory.getLogger(MQAdminExtImpl.class);
public MQAdminExtImpl() {
}
@Override
public void updateBrokerConfig(String brokerAddr, Properties properties)
throws RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException,
UnsupportedEncodingException, InterruptedException, MQBrokerException {
MQAdminInstance.threadLocalMQAdminExt().updateBrokerConfig(brokerAddr, properties);
}
@Override
public void createAndUpdateTopicConfig(String addr, TopicConfig config)
throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
MQAdminInstance.threadLocalMQAdminExt().createAndUpdateTopicConfig(addr, config);
}
@Override public void createAndUpdatePlainAccessConfig(String addr,
PlainAccessConfig plainAccessConfig) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
}
@Override public void deletePlainAccessConfig(String addr,
String accessKey) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
}
@Override public void updateGlobalWhiteAddrConfig(String addr,
String globalWhiteAddrs) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
}
@Override public ClusterAclVersionInfo examineBrokerClusterAclVersionInfo(
String addr) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
return null;
}
@Override public AclConfig examineBrokerClusterAclConfig(
String addr) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
return null;
}
@Override
public void createAndUpdateSubscriptionGroupConfig(String addr, SubscriptionGroupConfig config)
throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
MQAdminInstance.threadLocalMQAdminExt().createAndUpdateSubscriptionGroupConfig(addr, config);
}
@Override
public SubscriptionGroupConfig examineSubscriptionGroupConfig(String addr, String group) {
RemotingClient remotingClient = MQAdminInstance.threadLocalRemotingClient();
RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_ALL_SUBSCRIPTIONGROUP_CONFIG, null);
RemotingCommand response = null;
try {
response = remotingClient.invokeSync(addr, request, 3000);
}
catch (Exception err) {
throw Throwables.propagate(err);
}
assert response != null;
switch (response.getCode()) {
case ResponseCode.SUCCESS: {
SubscriptionGroupWrapper subscriptionGroupWrapper = decode(response.getBody(), SubscriptionGroupWrapper.class);
return subscriptionGroupWrapper.getSubscriptionGroupTable().get(group);
}
default:
throw Throwables.propagate(new MQBrokerException(response.getCode(), response.getRemark()));
}
}
@Override
public TopicConfig examineTopicConfig(String addr, String topic) {
RemotingClient remotingClient = MQAdminInstance.threadLocalRemotingClient();
RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_ALL_TOPIC_CONFIG, null);
RemotingCommand response = null;
try {
response = remotingClient.invokeSync(addr, request, 3000);
}
catch (Exception err) {
throw Throwables.propagate(err);
}
switch (response.getCode()) {
case ResponseCode.SUCCESS: {
TopicConfigSerializeWrapper topicConfigSerializeWrapper = decode(response.getBody(), TopicConfigSerializeWrapper.class);
return topicConfigSerializeWrapper.getTopicConfigTable().get(topic);
}
default:
throw Throwables.propagate(new MQBrokerException(response.getCode(), response.getRemark()));
}
没有合适的资源?快使用搜索试试~ 我知道了~
rocketMq运行监控
共1067个文件
js:826个
java:92个
css:33个
1 下载量 175 浏览量
2024-07-16
16:48:55
上传
评论
收藏 3.72MB ZIP 举报
温馨提示
rocketMq运行监控
资源推荐
资源详情
资源评论
收起资源包目录
rocketMq运行监控 (1067个子文件)
angular-material.min.css 402KB
bootstrap.css 144KB
bootstrap.min.css 122KB
bootstrap-material-design.css 105KB
bootstrap-material-design.css 94KB
bootstrap-material-design.min.css 92KB
btn.css 40KB
font-awesome.css 37KB
font-awesome.min.css 30KB
bootstrap-theme.css 26KB
docs.css 23KB
bootstrap-theme.min.css 23KB
chosen.css 14KB
main.css 11KB
normalize.css 9KB
bootstrap-datetimepicker.min.css 8KB
default.css 5KB
app.css 5KB
ngDialog-theme-default.css 4KB
timeline.css 3KB
jquery.dropdown.css 2KB
angular-ui-notification.css 2KB
angular-ui-notification.css 2KB
normalize.css 2KB
ngDialog.min.css 1KB
theme.css 1KB
ripples.css 1KB
ripples.min.css 1KB
ripples.css 761B
animate.css 534B
chosen-spinner.css 482B
angular-csp.css 343B
login.css 129B
Dockerfile 213B
fontawesome-webfont.eot 162KB
glyphicons-halflings-regular.eot 20KB
icomoon.eot 2KB
spinner.gif 2KB
404.html 23KB
topic.html 23KB
consumer.html 22KB
message.html 15KB
messageTrace.html 10KB
index.html 7KB
cluster.html 6KB
_header.html 3KB
producer.html 3KB
index.html 2KB
un_support_browser.html 2KB
login.html 2KB
ops.html 2KB
50x.html 819B
_footer.html 246B
MQAdminExtImpl.java 25KB
ConsumerServiceImpl.java 16KB
DashboardCollectTask.java 15KB
TopicServiceImpl.java 10KB
MessageServiceImpl.java 9KB
ConsumerServiceImplTest.java 8KB
RocketMQConsoleTestBase.java 7KB
TopicServiceImplTest.java 6KB
UserServiceImpl.java 6KB
DashboardCollectServiceImpl.java 6KB
TestRocketMQServer.java 6KB
JsonUtil.java 6KB
MessageServiceImplTest.java 6KB
TopicController.java 5KB
ConsumerController.java 5KB
RMQConfigure.java 5KB
MessageView.java 5KB
MsgTraceDecodeUtil.java 5KB
MessageTraceView.java 5KB
WebUtil.java 4KB
TestController.java 4KB
MQAdminInstance.java 4KB
AuthWebMVCConfigurerAdapter.java 4KB
MessageController.java 4KB
MonitorServiceImpl.java 4KB
LoginController.java 3KB
WebStaticApplicationTests.java 3KB
ClusterServiceImpl.java 3KB
MQAdminAspect.java 3KB
MessageTraceController.java 3KB
TopicConfigInfo.java 3KB
ProducerServiceImplTest.java 3KB
MonitorController.java 3KB
OpsServiceImpl.java 3KB
DashboardServiceImpl.java 3KB
GroupConsumeInfo.java 3KB
ClusterServiceImplTest.java 3KB
LoginServiceImpl.java 3KB
GlobalRestfulResponseBodyAdvice.java 2KB
QueueStatInfo.java 2KB
OpsServiceImplTest.java 2KB
ConsumerService.java 2KB
MessageTraceServiceImpl.java 2KB
OpsController.java 2KB
ConnectionInfo.java 2KB
DashboardController.java 2KB
User.java 2KB
共 1067 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
Java-xy²
- 粉丝: 31
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2025年医院招聘护士考试题库(附答案).doc
- 2025《医患沟通学》试题库及答案(通用版).docx
- 2025年医院招聘护士考试题库及答案.doc
- (2025)中医药知识与技能竞赛题库及答案.docx
- 2025《医疗器械经营监督管理办法》培训试题及答案.docx
- 2025年糖医帮认证考试试题及答案.docx
- 2025年糖医帮认证考试题库(附含答案).docx
- 2025年糖医帮认证考试题库及答案.docx
- 2025年医疗器械培训试题(含答案).docx
- 2025年医疗三基三严知识试题题库(附答案).docx
- 2025年医疗三基三严知识题库(含答案).docx
- 2025年医疗事业单位招聘医学基础知识题库及答案(通用版).docx
- 2025年医疗三基三严知识试题库及答案(通用版).docx
- 2025年医师定期考核必刷库附含答案.docx
- 2025年医师定期考核法律法规必刷题库及答案.docx
- 2025年医师定期考核试题及答案.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功