程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> JAVA編程 >> 關於JAVA >> 關於weblogic中jms message的狀態

關於weblogic中jms message的狀態

編輯:關於JAVA

今天同事問我說,如何處理RECEIVE、VISIBLE的JMS消息?有點懵,之前從沒有關注過消息的狀態。Weblogic81中,我們是不能看到 destination中的消息的,只能看到當前destination中,有多少message, 有多少pending的message。而92中,我們監控destination的時候,可以看到具體的message,而且message後面會跟一個state string。標題中說的RECEIVE、VISIBLE就是這個state string,其實state有很多,常見的也就是RECEIVE、VISIBLE。下面我們看看所有這些STATE在代碼(MessageInfo.java)中的解釋,

VISIBLE:Indicates that the message is visible on the destination.消息已經入列,等待被消費。

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. 消息已經入列,但因為TimeToDeliver還沒有到,直到TimeToDeliver,該消息才會變成VISIBLE。或者由於客戶端消費異常,比如onMessage中出現了RuntimeException,消息被recover後,等待Redelivery Delay時間到達,然後重新發送。

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.消息已經入列,且已經被DELIVER到某個CONSUMER,但CONSUMER的ACKNOWLEDGE還沒有收到。可能是網絡問題或客戶端設為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.消息已經入列,但目前send操作正在處理中(比如事務未提交),該消息對於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. 消息因為PAUSE被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. 消息反復REDELIVERY的上限已經到達,這樣的消息不會被重發。

根據消息的狀態,我們基本可以斷定JMS消息相關問題的位置,從而調查可以做到有的放矢。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved