对不起,麻烦大家了,我找到答案了,帮主帮我结了吧原因是我发送了一个非法用例(email),造成onmessage()事务rollback了
这样wl就会重新发送这个非法用例,永远rollback,所以出现了上面的情况
解决方案:
public void onMessage( Message incomingMsg )
{
// get the unique message Id
String msgId = incomingMsg.getJMSMessageID(); if ( previousMessages.containsKey(msgId) ) |#1
count = ( (Integer) msgMap.get(msgId) ).intValue(); // if msg has been retried couple of times, discard it.
if ( count < _MAX_REDLIVERY_CONST_ ) |#2
{
logMessage(incomingMsg);
return;
} //perform business logic for message
boolean error = doBusinessFunction(); if ( error ) |#3
{
mdbContext.setRollBackOnly(); |#3
previousMessages.put( msgId, new Integer(++count) );
}
}谢谢
这样wl就会重新发送这个非法用例,永远rollback,所以出现了上面的情况
解决方案:
public void onMessage( Message incomingMsg )
{
// get the unique message Id
String msgId = incomingMsg.getJMSMessageID(); if ( previousMessages.containsKey(msgId) ) |#1
count = ( (Integer) msgMap.get(msgId) ).intValue(); // if msg has been retried couple of times, discard it.
if ( count < _MAX_REDLIVERY_CONST_ ) |#2
{
logMessage(incomingMsg);
return;
} //perform business logic for message
boolean error = doBusinessFunction(); if ( error ) |#3
{
mdbContext.setRollBackOnly(); |#3
previousMessages.put( msgId, new Integer(++count) );
}
}谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货