如何处理容器托管,自动确认,不支持事务,邮件重新传递的MDB异常 [英] How to handle Container Managed,Auto Acknowledge, Transaction Not Supported, MDB exception for message redelivery
问题描述
我有一个MDB-EJB 2.1,WebSphere 7版本
I got a MDB - EJB 2.1, WebSphere 7 version
容器托管并自动确认
标记为Not Supported
现在我该如何处理异常,以使消息在异常期间得以保留并在以后重新发送?
Now how do I handle exceptions in a way that the message will be preserved during exception and redelivered later?
我试图从MDB onMessage
方法内的catch块引发运行时异常.但这似乎阻止了MDB侦听器,这是意外的.
I tried to throw runtime exception from the catch block inside my MDB onMessage
method. But that seems to stop the MDB Listener which is unexpected.
由于没有交易,我无法致电context.setRollBackOnly()
.
I cannot call context.setRollBackOnly()
as there is no transaction.
推荐答案
RuntimeException
should be fine. Check this out Message-driven beans - transaction support. If your Listener stops, then you have probably Maximum retries
set to 0. Set it to something higher.
这篇关于如何处理容器托管,自动确认,不支持事务,邮件重新传递的MDB异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!