• 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
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Message redelivery - is it default?

 
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.
 
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic