• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to stop MDB retry invocation during System Exception

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.





 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic