2.RocketMQ研究

一、通过后台命令查看

1.首先登陆nameserver主机地址。

cd /root/rocketmq/bin

2.mq支持以下命令

The most commonly used mqadmin commands are:
   updateTopic          Update or create topic
   deleteTopic          Delete topic from broker and NameServer.
   updateSubGroup       Update or create subscription group
   deleteSubGroup       Delete subscription group from broker.
   updateBrokerConfig   Update broker's config
   topicRoute           Examine topic route info
   topicStatus          Examine topic Status info
   brokerStatus         Fetch broker runtime status data
   queryMsgById         Query Message by Id
   queryMsgByKey        Query Message by Key
   queryMsgByOffset     Query Message by offset
   printMsg             Print Message Detail
   producerConnection   Query producer's socket connection and client version
   consumerConnection   Query consumer's socket connection, client version and subscription
   consumerProgress     Query consumers's progress, speed
   consumerStatus       Query consumer's internal data structure
   cloneGroupOffset     clone offset from other group.
   clusterList          List all of clusters
   topicList            Fetch all topic list from name server
   updateKvConfig       Create or update KV config.
   deleteKvConfig       Delete KV config.
   wipeWritePerm        Wipe write perm of broker in all name server
   resetOffsetByTime    Reset consumer offset by timestamp(without client restart).
   updateOrderConf      Create or update or delete order conf
   cleanExpiredCQ       Clean expired ConsumeQueue on broker.
   startMonitoring      Start Monitoring
   checkMsg             Check Message Store
   statsAll             Topic and Consumer tps stats
   syncDocs             Synchronize wiki and issue to github.com

3.查看帮助命令

sh mqadmin consumerProgress --help
usage: mqadmin consumerProgress [-g <arg>] [-h] [-n <arg>]
 -g,--groupName <arg>     consumer group name
 -h,--help                Print help
 -n,--namesrvAddr <arg>   Name server address list, eg: 192.168.0.1:9876;192.168.0.2:9876

4.执行以下命令就可以查看消费者堆积的消息

sh mqadmin consumerProgress -g consumeGroupName
eg:
sh mqadmin consumerProgress -g test
#Topic                            #Broker Name                      #QID  #Broker Offset        #Consumer Offset      #Diff
test                              mqbroker22                        0     21232                 21232                 0
test                              mqbroker22                        1     21197                 21197                 0
test                              mqbroker25                        0     21186                 21186                 0
test                              mqbroker25                        1     21183                 21183                 0

Broker Offset为生产的条数

Consumer Offset为消费的条数
Diff为堆积的条数

二、通过rocketmq控制台查看

在这里插入图片描述
通过消费组就能知道对应哪些broker,以及每个broker的堆积条数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值