Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ques about message beans

 
Giju George
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.
 
Nitin Mehhta
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic