File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes How to stop MDB retry invocation during System Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to stop MDB retry invocation during System Exception " Watch "How to stop MDB retry invocation during System Exception " New topic
Author

How to stop MDB retry invocation during System Exception

Viji San
Ranch Hand

Joined: Aug 12, 2010
Posts: 35
I'm using CMT MDB to consume the message from Websphere MQ and it is deployed in Websphere application server.

Once the message is received by MDB, MDB delegates the message to application to process it further. If there is any system exception (example: Data base exception), seems, the transaction is rolled back and MQ keeps trying to send the same message. But I do not want MQ to resending the message to MDB if there an system exception occurred in the application since I do not want to process the message again if it is not processed in the first attempt.

What is the best approach to stop the retry ? Can this be handled in MDB or something needs to be done in MQ or WAS ?
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

Catch java.lang.Exception and allow the method to terminate normally.
If that is not possible due to some reason, check if your MessageProvider sets the 'JMSRedelivered' flag for messages that are redelivered. Most servers do. In which case, just check if it's a redelivered message and return normally.



cheers,
ram.





 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to stop MDB retry invocation during System Exception