今天同事问我说,如何处理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。
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.消息已经入列,且正在被DELIVER到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消息相关问题的位置,从而调查可以做到有的放矢。[@more@]
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。
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.消息已经入列,且正在被DELIVER到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消息相关问题的位置,从而调查可以做到有的放矢。[@more@]
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21645448/viewspace-1022396/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21645448/viewspace-1022396/