-------消息详情------------------------------------------------------------------------------------------------------------------------------------------------------

>>根据offsetMsgId查询msg,如果使用开源控制台,应使用offsetMsgId

mqadmin queryMsgById -i C0A8380100002A9F00000000000A8117 -n localhost:9876

>>根据topic 和key 查询msg

mqadmin queryMsgByKey -n localhost:9876 -t msgTopic -k key1609750345214

>>根据MsgId 和 topic 查询msg

mqadmin queryMsgByUniqueKey -n localhost:9876 -i msgId -t msgTopic

-------消费组情况------------------------------------------------------------------------------------------------------------------------------------------------------

>>查看订阅组消费状态,可以查看具体的client IP的消息积累量

mqadmin consumerProgress -n localhost:9876

>>查看消费者状态,包括同一个分组订阅的消费者信息

mqadmin consumerStatus -n localhost:9876 -g please_rename_unique_group_name11

>> 查询 Consumer 的网络连接

mqadmin consumerConnection -n localhost:9876 -g please_rename_unique_group_name

-------生产者情况------------------------------------------------------------------------------------------------------------------------------------------------------

>>查询 Producer 的网络连接

mqadmin producerConnection -n localhost:9876 -t WebSocketMsgTopic -g WebSocketMsgGroup

-------Topic相关------------------------------------------------------------------------------------------------------------------------------------------------------

>>查看 Topic 列表信息

mqadmin topicList -n localhost:9876

>>查看 Topic 路由信息

mqadmin topicRoute -n localhost:9876  -t WebSocketMsgTopic

 

>>查看 Topic 消息队列offset

mqadmin topicStatus -n localhost:9876 -t WebSocketMsgTopic

 

>>打印Topic订阅关系、TPS、积累量、24h读写总量等信息

mqadmin statsAll -n localhost:9876

 

-------拓展------------------------------------------------------------------------------------------------------------------------------------------------------

>>在RocketMQ中msgId和offsetMsgId的含义与区别

使用RocketMQ完成生产者客户端消息发送后,通常会看到如下日志打印信息:

SendResult [sendStatus=SEND_OK, msgId=0A42333A0DC818B4AAC246C290FD0000, offsetMsgId=0A42333A00002A9F000000000134F1F5, messageQueue=MessageQueue [topic=topicTest1, BrokerName=mac.local, queueId=3], queueOffset=4]
  • msgId,对于客户端来说msgId是由客户端producer实例端生成的,具体来说,调用方法MessageClientIDSetter.createUniqIDBuffer()生成唯一的Id;
  • offsetMsgId,offsetMsgId是由Broker服务端在写入消息时生成的(采用”IP地址+Port端口”与“CommitLog的物理偏移量地址”做了一个字符串拼接),其中offsetMsgId就是在RocketMQ控制台直接输入查询的那个messageId。
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐