Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

ques about message beans

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the different circumstances that will make the container to put the message back in the queue ???

According to HFE,
For CMT :- When a transaction rollback occurs.
For BMT :- When a RuntimeException occurs .

Is that all ???

Also spec 15.4.10 says Message-driven beans, like other well-behaved JMS MessageListeners, should not, in general, throw
RuntimeExceptions.
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually according to my interpretation of what I have read I think in the cases where the delivery system does not get a acknowledgement of the message a redelivery takes place. For a CMT the acknoledgement is always tied up with the transaction. So if transaction rolls back we get the redelivery...even if it is done by calling setRollBackOnly()... where as in the case of a BMT Message bean the transaction is tied to the method completion. So if we setRollBack using code and the method returns fine...i mean completes then no redelivery happens. Only if we get a system exception ..where the method fails to complete we get a redelivery.
 
Nitin Mehhta
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And yes we should not throw Runtime exceptions...it is just that something which we are not expecting happens then these exceptions are generated from the running code. So they are propogated automatically. I think by that the specs means that we should not explicitly throw any runtime exception.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic