How to handle Container Managed,Auto Acknowledge, Transaction Not Supported, MDB exception for message redelivery

不羁的心 提交于 2019-12-12 01:51:27

问题


I got a MDB - EJB 2.1, WebSphere 7 version

Container Managed and Auto Acknowledged

Transactions marked as Not Supported

Now how do I handle exceptions in a way that the message will be preserved during exception and redelivered later?

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.

I cannot call context.setRollBackOnly() as there is no transaction.


回答1:


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.



来源:https://stackoverflow.com/questions/29268246/how-to-handle-container-managed-auto-acknowledge-transaction-not-supported-mdb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!