RocketMQ 运维管理-常用快捷命令

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

>>根据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。
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cy谭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值