溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

RocketMQ如何查詢(xún)死信隊(duì)列中的消息內(nèi)容

發(fā)布時(shí)間:2021-11-17 17:13:21 來(lái)源:億速云 閱讀:863 作者:柒染 欄目:大數(shù)據(jù)

今天就跟大家聊聊有關(guān)RocketMQ如何查詢(xún)死信隊(duì)列中的消息內(nèi)容,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

 說(shuō)明

RocketMQ中當(dāng)重試消息超過(guò)最大重試次數(shù)(默認(rèn)16次),會(huì)被發(fā)送到%DLQ%開(kāi)頭的死信隊(duì)列,默認(rèn)死信隊(duì)列為只寫(xiě)權(quán)限。在有些情況下,想看看死信隊(duì)列里的內(nèi)容。

 1.更改死信隊(duì)列權(quán)限

bin/mqadmin updateTopicPerm -c ClusterB -t %DLQ%online-tst -p 6 -n 192.168.1.x:9876
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
update topic perm from 2 to 6 in 192.168.1.x:10911 success.
update topic perm from 2 to 6 in 192.168.1.x:10911 success.
update topic perm from 2 to 6 in 192.168.1.x:10911 success.
update topic perm from 2 to 6 in 192.168.1.x:10911 success.

注:將死信隊(duì)列只寫(xiě)權(quán)限更改為讀寫(xiě)權(quán)限

 2.查詢(xún)死信隊(duì)列狀態(tài)

bin/mqadmin topicStatus -n 192.168.1.x:9876 -t %DLQ%online-tst
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Broker Name QID Min Offset Max Offset Last Updated
broker-a 0 0 109 2018-12-10 18:03:08,732
broker-a 1 0 109 2018-12-10 18:03:08,740
broker-a 2 0 110 2018-12-10 18:03:08,750
broker-a 3 0 109 2018-12-10 18:03:08,728

   3.根據(jù)offset查詢(xún)消息內(nèi)容

bin/mqadmin queryMsgByOffset -n localhost:9876 -t %DLQ%online-tst -b broker-a -i 0 -o 108
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
OffsetID: 0A090F2800002A9F000000D70519DD35
OffsetID: 0A090F2800002A9F000000D70519DD35
Topic: %DLQ%online-tst
Tags: [null]
Keys: [null]
Queue ID: 0
Queue Offset: 108
CommitLog Offset: 923503549749
Reconsume Times: 0
Born Timestamp: 2018-12-10 17:59:24,731
Store Timestamp: 2018-12-10 18:03:08,732
Born Host: 10.10.128.183:51889
Store Host: 10.9.15.40:10911
System Flag: 0
Properties: {MIN_OFFSET=0, MAX_OFFSET=109, UNIQ_KEY=0A0A80B78DE818B4AAC22FA2493B01B2, WAIT=true}
Message Body Path: /tmp/rocketmq/msgbodys/0A0A80B78DE818B4AAC22FA2493B01B2

注:使用打印命令消息臨時(shí)存儲(chǔ)在/tmp/rocketmq/msgbodys

 4.查看消息內(nèi)容

cat /tmp/rocketmq/msgbodys/0A0A80B78DE818B4AAC22FA2490F01AE
Hello RocketMQ430

看完上述內(nèi)容,你們對(duì)RocketMQ如何查詢(xún)死信隊(duì)列中的消息內(nèi)容有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注億速云行業(yè)資訊頻道,感謝大家的支持。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI