• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to stop MDB retry invocation during System Exception

 
Viji San
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 489
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.





 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic