posts - 42,comments - 83,trackbacks - 0
                  今天同事問我說,如何處理RECEIVE、VISIBLE的JMS消息?有點(diǎn)懵,之前從沒有關(guān)注過消息的狀態(tài)。Weblogic81中,我們是不能看到destination中的消息的,只能看到當(dāng)前destination中,有多少message, 有多少pending的message。而92中,我們監(jiān)控destination的時(shí)候,可以看到具體的message,而且message后面會跟一個state string。標(biāo)題中說的RECEIVE、VISIBLE就是這個state string,其實(shí)state有很多,常見的也就是RECEIVE、VISIBLE。下面我們看看所有這些STATE在代碼(MessageInfo.java)中的解釋,

          VISIBLE:Indicates that the message is visible on the destination.消息已經(jīng)入列,等待被消費(fèi)。

          ORDERED:Indicates that the message belongs to a Unit of Order. 消息處于某個unit中。

          DELAYED:Indicates that the message exists on the destination but is classified as pending because it has a scheduled delivery time or is delayed. 消息已經(jīng)入列,但因?yàn)門imeToDeliver還沒有到,直到TimeToDeliver,該消息才會變成VISIBLE?;蛘哂捎诳蛻舳讼M(fèi)異常,比如onMessage中出現(xiàn)了RuntimeException,消息被recover后,等待Redelivery Delay時(shí)間到達(dá),然后重新發(fā)送。

          RECEIVE:Indicates that the message exists on the destination but is classified as pending because it has been received but not acknowledged. The actual state may also include STATE_TRANSACTION if the receive operation was performed as part of a transaction.消息已經(jīng)入列,且已經(jīng)被DELIVER到某個CONSUMER,但CONSUMER的ACKNOWLEDGE還沒有收到??赡苁蔷W(wǎng)絡(luò)問題或客戶端設(shè)為CLIENT_ACK模式。

          SEND:Indicates that the message exists on the destination but is classified as pending because it is part of a send operation that is in progress. The actual state may also include STATE_TRANSACTION if the send operation was perfromed as part of a transaction.消息已經(jīng)入列,但目前send操作正在處理中(比如事務(wù)未提交),該消息對于consumer是不可用的。

          TRANSACTION:Indicates that the message exists on the destination but is classified as pending because it is part of a send or receive operation that is being performed as part of a global transaction.

          PAUSED:Indicates that the message exists on the destination but is being held in a pending state because of a pause operation. 消息因?yàn)镻AUSE被PENDING在DEST中。

          REDELIVERY_COUNT_EXCEEDED:Indicates that the message has exceeded the redelivery count set for the destination and is no longer available for consumption. 消息反復(fù)REDELIVERY的上限已經(jīng)到達(dá),這樣的消息不會被重發(fā)。

                  根據(jù)消息的狀態(tài),我們基本可以斷定JMS消息相關(guān)問題的位置,從而調(diào)查可以做到有的放矢。




          posted on 2009-05-21 15:27 走走停停又三年 閱讀(1654) 評論(0)  編輯  收藏 所屬分類: Weblogic
          主站蜘蛛池模板: 康平县| 靖江市| 边坝县| 靖宇县| SHOW| 台北县| 昭通市| 酉阳| 东乌珠穆沁旗| 开远市| 阳原县| 青岛市| 古丈县| 广宁县| 宾阳县| 博兴县| 雅江县| 蓬溪县| 萨嘎县| 扶沟县| 兴国县| 河北区| 泸水县| 天等县| 太仆寺旗| 靖江市| 云林县| 汉川市| 澳门| 临朐县| 阳山县| 平谷区| 临澧县| 江阴市| 阳春市| 隆子县| 崇信县| 鄂托克前旗| 百色市| 宜宾县| 甘孜|