com.alibaba.rocketmq.tools.admin
接口 MQAdminExt

所有超级接口:
MQAdmin
所有已知实现类:
DefaultMQAdminExt, DefaultMQAdminExtImpl

public interface MQAdminExt
extends MQAdmin

MQ管理类接口,涉及所有与MQ管理相关的对外接口
包括Topic创建、订阅组创建、配置修改等

从以下版本开始:
2013-7-14

方法摘要
 void createAndUpdateKvConfig(String namespace, String key, String value)
          在 namespace 上添加或者更新 KV 配置
 void createAndUpdateSubscriptionGroupConfig(String addr, SubscriptionGroupConfig config)
          向指定Broker创建或者更新订阅组配置
 void createAndUpdateTopicConfig(String addr, TopicConfig config)
          向指定Broker创建或者更新Topic配置
 void createOrUpdateOrderConf(String key, String value, boolean isCluster)
          创建或更新顺序消息的分区配置
 void deleteIpsByProjectGroup(String key)
          删除 project group 对应的所有 server ip
 void deleteKvConfig(String namespace, String key)
          删除 namespace 上的 KV 配置
 void deleteSubscriptionGroup(String addr, String groupName)
          删除 broker 上的 subscription group 信息
 void deleteTopicInBroker(Set<String> addrs, String topic)
          删除 broker 上的 topic 信息
 void deleteTopicInNameServer(Set<String> addrs, String topic)
          删除 broker 上的 topic 信息
 ClusterInfo examineBrokerClusterInfo()
          查看集群信息
 ConsumerConnection examineConsumerConnectionInfo(String consumerGroup)
          查看Consumer网络连接、订阅关系
 ConsumeStats examineConsumeStats(String consumerGroup)
          查询消费进度
 ProducerConnection examineProducerConnectionInfo(String producerGroup, String topic)
          查看Producer网络连接
 SubscriptionGroupConfig examineSubscriptionGroupConfig(String addr, String group)
          查询指定Broker的订阅组配置
 TopicConfig examineTopicConfig(String addr, String topic)
          查询指定Broker的Topic配置
 TopicRouteData examineTopicRouteInfo(String topic)
          查看Topic路由信息
 TopicStatsTable examineTopicStats(String topic)
          查询Topic Offset信息
 TopicList fetchAllTopicList()
          从Name Server获取所有Topic列表
 KVTable fetchBrokerRuntimeStats(String brokerAddr)
          获取Broker运行时数据
 Map<String,Map<MessageQueue,Long>> getConsumeStatus(String topic, String group, String clientAddr)
          通过客户端查看消费者的消费情况
 String getIpsByProjectGroup(String projectGroup)
          通过 project 获取所有的 server ip 信息
 String getKVConfig(String namespace, String key)
          从Name Server获取一个配置项
 KVTable getKVListByNamespace(String namespace)
          获取指定Namespace下的所有kv
 List<String> getNameServerAddressList()
          获取Name Server地址列表
 String getProjectGroupByIp(String ip)
          通过 server ip 获取 project 信息
 void putKVConfig(String namespace, String key, String value)
          向Name Server增加一个配置项
 Set<QueueTimeSpan> queryConsumeTimeSpan(String topic, String group)
          根据 topic 和 group 获取消息的时间跨度
 GroupList queryTopicConsumeByWho(String topic)
          根据Topic查询被哪些订阅组消费
 Map<MessageQueue,Long> resetOffsetByTimestamp(String topic, String group, long timestamp, boolean isForce)
          按照时间回溯消费进度(客户端不需要重启)
 List<RollbackStats> resetOffsetByTimestampOld(String consumerGroup, String topic, long timestamp, boolean force)
          按照时间回溯消费进度(客户端需要重启)
 void shutdown()
           
 void start()
           
 void updateBrokerConfig(String brokerAddr, Properties properties)
          更新Broker配置
 ConsumeByWho whoConsumeTheMessage(String msgId)
          查看某个订阅组被谁消费了
 int wipeWritePermOfBroker(String namesrvAddr, String brokerName)
          清除某个Broker的写权限,针对所有Name Server
 
从接口 com.alibaba.rocketmq.client.MQAdmin 继承的方法
createTopic, earliestMsgStoreTime, maxOffset, minOffset, queryMessage, searchOffset, viewMessage
 

方法详细信息

start

void start()
           throws MQClientException
抛出:
MQClientException

shutdown

void shutdown()

updateBrokerConfig

void updateBrokerConfig(String brokerAddr,
                        Properties properties)
                        throws RemotingConnectException,
                               RemotingSendRequestException,
                               RemotingTimeoutException,
                               UnsupportedEncodingException,
                               InterruptedException,
                               MQBrokerException
更新Broker配置

参数:
brokerAddr -
properties -
抛出:
MQBrokerException
InterruptedException
UnsupportedEncodingException
RemotingTimeoutException
RemotingSendRequestException
RemotingConnectException

createAndUpdateTopicConfig

void createAndUpdateTopicConfig(String addr,
                                TopicConfig config)
                                throws RemotingException,
                                       MQBrokerException,
                                       InterruptedException,
                                       MQClientException
向指定Broker创建或者更新Topic配置

参数:
addr -
config -
抛出:
MQClientException
InterruptedException
MQBrokerException
RemotingException

createAndUpdateSubscriptionGroupConfig

void createAndUpdateSubscriptionGroupConfig(String addr,
                                            SubscriptionGroupConfig config)
                                            throws RemotingException,
                                                   MQBrokerException,
                                                   InterruptedException,
                                                   MQClientException
向指定Broker创建或者更新订阅组配置

参数:
addr -
config -
抛出:
MQClientException
InterruptedException
MQBrokerException
RemotingException

examineSubscriptionGroupConfig

SubscriptionGroupConfig examineSubscriptionGroupConfig(String addr,
                                                       String group)
查询指定Broker的订阅组配置

参数:
addr -
group -
返回:

examineTopicConfig

TopicConfig examineTopicConfig(String addr,
                               String topic)
查询指定Broker的Topic配置

参数:
addr -
topic -
返回:

examineTopicStats

TopicStatsTable examineTopicStats(String topic)
                                  throws RemotingException,
                                         MQClientException,
                                         InterruptedException,
                                         MQBrokerException
查询Topic Offset信息

参数:
topic -
返回:
抛出:
RemotingException
MQClientException
InterruptedException
MQBrokerException

fetchAllTopicList

TopicList fetchAllTopicList()
                            throws RemotingException,
                                   MQClientException,
                                   InterruptedException
从Name Server获取所有Topic列表

返回:
抛出:
InterruptedException
MQClientException
RemotingException

fetchBrokerRuntimeStats

KVTable fetchBrokerRuntimeStats(String brokerAddr)
                                throws RemotingConnectException,
                                       RemotingSendRequestException,
                                       RemotingTimeoutException,
                                       InterruptedException,
                                       MQBrokerException
获取Broker运行时数据

返回:
抛出:
MQBrokerException
InterruptedException
RemotingTimeoutException
RemotingSendRequestException
RemotingConnectException

examineConsumeStats

ConsumeStats examineConsumeStats(String consumerGroup)
                                 throws RemotingException,
                                        MQClientException,
                                        InterruptedException,
                                        MQBrokerException
查询消费进度

参数:
consumerGroup -
返回:
抛出:
InterruptedException
MQClientException
RemotingException
MQBrokerException

examineBrokerClusterInfo

ClusterInfo examineBrokerClusterInfo()
                                     throws InterruptedException,
                                            MQBrokerException,
                                            RemotingTimeoutException,
                                            RemotingSendRequestException,
                                            RemotingConnectException
查看集群信息

返回:
抛出:
InterruptedException
MQBrokerException
RemotingTimeoutException
RemotingSendRequestException
RemotingConnectException

examineTopicRouteInfo

TopicRouteData examineTopicRouteInfo(String topic)
                                     throws RemotingException,
                                            MQClientException,
                                            InterruptedException
查看Topic路由信息

参数:
topic -
返回:
抛出:
RemotingException
MQClientException
InterruptedException

examineConsumerConnectionInfo

ConsumerConnection examineConsumerConnectionInfo(String consumerGroup)
                                                 throws RemotingConnectException,
                                                        RemotingSendRequestException,
                                                        RemotingTimeoutException,
                                                        InterruptedException,
                                                        MQBrokerException,
                                                        RemotingException,
                                                        MQClientException
查看Consumer网络连接、订阅关系

参数:
consumerGroup -
返回:
抛出:
MQBrokerException
InterruptedException
RemotingTimeoutException
RemotingSendRequestException
RemotingConnectException
MQClientException
RemotingException

examineProducerConnectionInfo

ProducerConnection examineProducerConnectionInfo(String producerGroup,
                                                 String topic)
                                                 throws RemotingException,
                                                        MQClientException,
                                                        InterruptedException,
                                                        MQBrokerException
查看Producer网络连接

参数:
producerGroup -
topic -
返回:
抛出:
InterruptedException
MQClientException
RemotingException
MQBrokerException

getNameServerAddressList

List<String> getNameServerAddressList()
获取Name Server地址列表

返回:

wipeWritePermOfBroker

int wipeWritePermOfBroker(String namesrvAddr,
                          String brokerName)
                          throws RemotingCommandException,
                                 RemotingConnectException,
                                 RemotingSendRequestException,
                                 RemotingTimeoutException,
                                 InterruptedException,
                                 MQClientException
清除某个Broker的写权限,针对所有Name Server

参数:
brokerName -
返回:
返回清除了多少个topic
抛出:
MQClientException
InterruptedException
RemotingTimeoutException
RemotingSendRequestException
RemotingConnectException
RemotingCommandException

whoConsumeTheMessage

ConsumeByWho whoConsumeTheMessage(String msgId)
查看某个订阅组被谁消费了

参数:
msgId -
返回:

putKVConfig

void putKVConfig(String namespace,
                 String key,
                 String value)
向Name Server增加一个配置项

参数:
namespace -
key -
value -

getKVConfig

String getKVConfig(String namespace,
                   String key)
                   throws RemotingException,
                          MQClientException,
                          InterruptedException
从Name Server获取一个配置项

参数:
namespace -
key -
返回:
抛出:
RemotingException
MQClientException
InterruptedException

getKVListByNamespace

KVTable getKVListByNamespace(String namespace)
                             throws RemotingException,
                                    MQClientException,
                                    InterruptedException
获取指定Namespace下的所有kv

参数:
namespace -
返回:
抛出:
InterruptedException
MQClientException
RemotingException

deleteTopicInBroker

void deleteTopicInBroker(Set<String> addrs,
                         String topic)
                         throws RemotingException,
                                MQBrokerException,
                                InterruptedException,
                                MQClientException
删除 broker 上的 topic 信息

参数:
addrs -
topic -
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

deleteTopicInNameServer

void deleteTopicInNameServer(Set<String> addrs,
                             String topic)
                             throws RemotingException,
                                    MQBrokerException,
                                    InterruptedException,
                                    MQClientException
删除 broker 上的 topic 信息

参数:
addrs -
topic -
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

deleteSubscriptionGroup

void deleteSubscriptionGroup(String addr,
                             String groupName)
                             throws RemotingException,
                                    MQBrokerException,
                                    InterruptedException,
                                    MQClientException
删除 broker 上的 subscription group 信息

参数:
addr -
groupName -
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

createAndUpdateKvConfig

void createAndUpdateKvConfig(String namespace,
                             String key,
                             String value)
                             throws RemotingException,
                                    MQBrokerException,
                                    InterruptedException,
                                    MQClientException
在 namespace 上添加或者更新 KV 配置

参数:
namespace -
key -
value -
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

deleteKvConfig

void deleteKvConfig(String namespace,
                    String key)
                    throws RemotingException,
                           MQBrokerException,
                           InterruptedException,
                           MQClientException
删除 namespace 上的 KV 配置

参数:
namespace -
key -
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

getProjectGroupByIp

String getProjectGroupByIp(String ip)
                           throws RemotingException,
                                  MQBrokerException,
                                  InterruptedException,
                                  MQClientException
通过 server ip 获取 project 信息

参数:
ip -
返回:
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

getIpsByProjectGroup

String getIpsByProjectGroup(String projectGroup)
                            throws RemotingException,
                                   MQBrokerException,
                                   InterruptedException,
                                   MQClientException
通过 project 获取所有的 server ip 信息

参数:
projectGroup -
返回:
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

deleteIpsByProjectGroup

void deleteIpsByProjectGroup(String key)
                             throws RemotingException,
                                    MQBrokerException,
                                    InterruptedException,
                                    MQClientException
删除 project group 对应的所有 server ip

参数:
key -
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

resetOffsetByTimestampOld

List<RollbackStats> resetOffsetByTimestampOld(String consumerGroup,
                                              String topic,
                                              long timestamp,
                                              boolean force)
                                              throws RemotingException,
                                                     MQBrokerException,
                                                     InterruptedException,
                                                     MQClientException
按照时间回溯消费进度(客户端需要重启)

参数:
consumerGroup -
topic -
timestamp -
force -
返回:
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

resetOffsetByTimestamp

Map<MessageQueue,Long> resetOffsetByTimestamp(String topic,
                                              String group,
                                              long timestamp,
                                              boolean isForce)
                                              throws RemotingException,
                                                     MQBrokerException,
                                                     InterruptedException,
                                                     MQClientException
按照时间回溯消费进度(客户端不需要重启)

参数:
topic -
group -
timestamp -
isForce -
返回:
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

getConsumeStatus

Map<String,Map<MessageQueue,Long>> getConsumeStatus(String topic,
                                                    String group,
                                                    String clientAddr)
                                                    throws RemotingException,
                                                           MQBrokerException,
                                                           InterruptedException,
                                                           MQClientException
通过客户端查看消费者的消费情况

参数:
topic -
group -
clientAddr -
返回:
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

createOrUpdateOrderConf

void createOrUpdateOrderConf(String key,
                             String value,
                             boolean isCluster)
                             throws RemotingException,
                                    MQBrokerException,
                                    InterruptedException,
                                    MQClientException
创建或更新顺序消息的分区配置

参数:
key -
value -
isCluster -
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

queryTopicConsumeByWho

GroupList queryTopicConsumeByWho(String topic)
                                 throws RemotingConnectException,
                                        RemotingSendRequestException,
                                        RemotingTimeoutException,
                                        InterruptedException,
                                        MQBrokerException,
                                        RemotingException,
                                        MQClientException
根据Topic查询被哪些订阅组消费

参数:
topic -
返回:
抛出:
MQBrokerException
InterruptedException
RemotingTimeoutException
RemotingSendRequestException
RemotingConnectException
MQClientException
RemotingException

queryConsumeTimeSpan

Set<QueueTimeSpan> queryConsumeTimeSpan(String topic,
                                        String group)
                                        throws InterruptedException,
                                               MQBrokerException,
                                               RemotingException,
                                               MQClientException
根据 topic 和 group 获取消息的时间跨度

参数:
topic -
group -
返回:
抛出:
RemotingConnectException
RemotingSendRequestException
RemotingTimeoutException
InterruptedException
MQBrokerException
RemotingException
MQClientException


Copyright © 2012-2014. All Rights Reserved.