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

Message redelivery - is it default?

 
Rajesh So
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have studied that when MDB has Tx Required, the redelivery semantics applied.

I threw an exception from an onMessage() method, but always get redelivery happening. I tried to change the Transaction attributes to Required and Not Supported, but that does not seem to make any difference.


The logs contain the proof for redelievery.



Could you help me understand.

Thanks in advance,
Rajesh
 
Rajesh So
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have come near the solution.

The magic of redelivery happened because of context.setRollbackOnly(). When I commented that line, the exception did not cause the message to get redelivered.

There was no change in behavior when the onMessage had Transaction attribute as REQUIRED or NOT_SUPPORTED. I read in one exam simulator that a guaranteed message consumption and persistence of the message in DB requires that the MDB start the consumption with a Transaction required. However, with just context.setRollbackOnly() that could be achieved.

May i have your input on this.

Regards,
Rajesh

 
Rajesh So
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I did not find any differences or benefits in using either of the Transaction attributes in the onMessage method. Could you please help me when to use either of them and what are the benefits.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic