赞
踩
在生产环境上发现某条消息无法通过console进行重发,报错信息如下:
org.apache.rocketmq.client.exception.MQClientException:
CODE: 208 DESC: query message by key finished, but no message.
For more information, please visit the url, http://rocketmq.apache.org/docs/faq/
MQAdminImpl.class
public MessageExt queryMessageByUniqKey(String topic,
String uniqKey) throws InterruptedException, MQClientException {
QueryResult qr = queryMessageByUniqKey(topic, uniqKey, 32,
MessageClientIDSetter.getNearlyTimeFromID(uniqKey).getTime() - 1000, Long.MAX_VALUE);
if (qr != null && qr.getMessageList() != null && qr.getMessageList().size() > 0) {
return qr.getMessageList().get(0);
} else {
return null;
}
}
从msgId中解析出时间,从该时间点开始查询broker中的信息,接下来用mqadmin命令查看这条消息的相关时间信息
./mqadmin queryMsgByUniqueKey -n xxx:xxx-t xxx-i 7F0000015xxxxxxx0159
Topic: xxx
Tags: [xxx]
Keys: [xxx]
Queue ID: 7
Queue Offset: 15697
CommitLog Offset: 549800974789
Reconsume Times: 0
Born Timestamp: 2023-04-19 17:31:23,025
Store Timestamp: 2023-04-19 17:31:22,937
Born Host: ip1:port1
Store Host: ip2:port2
System Flag: 0
producer、 broker ntp时间同步,误差在1秒以内都能够正常查询到消息
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。