RocketMQ常用命令
常用命令
获取所有可用命令:mqadmin
查看帮助:mqadmin <command> -h
查询Producer的网络连接情况:sh mqadmin producerConnection -n localhost:9876 -g <producer-group> -t <producer-topic>
查询Consumer的网络连接情况:sh mqadmin consumerConnection -n localhost:9876 -g <consumer-group>
查询Consumer的消费状态:sh mqadmin consumerProgress -n localhost:9876 -g <consumer-group>
查询消息是否发送成功
获取指定Topic:mqadmin topicList -n localhost:9876 | grep <topicName>
查看Topic状态:mqadmin topicStatus -n localhost:9876 -t <topicName>
根据offset获取消息:sh mqadmin queryMsgByOffset -n localhost:9876 -b <broker-name> -i <queueId> -o <offset> -t <topicName>
根据offsetMsgId查询消息:sh mqadmin queryMsgById -n localhost:9876 -i <offsetMsgId>
查询消息是否被消费成功
查询消息详情:mqadmin queryMsgById -i {MsgId} -n {NameServerAddr}
查看Consumer Group订阅了哪些TOPIC:
mqadmin consumerProgress -g <ConsumerGroup> -n <NameServerAddr>
查询TOPIC被哪些Consumer Group订阅了
没有查询特定TOPIC订阅情况,只能查询所有后再过滤:mqadmin statsAll -n <NameServerAddr> | grep <TOPIC>
返回结果:#Topic #Consumer Group #InTPS #OutTPS #InMsg24Hour #OutMsg24Hour