查看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 ] [-h] [-n ]
 -g,--groupName      consumer group name
 -h,--help                Print help
 -n,--namesrvAddr    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控制台查看

查看rocketmq消费情况_第1张图片



你可能感兴趣的:(Rocketmq)