This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes JMS:Difference between CLIENT and AUTO_ACKNOWLEDGE modes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS:Difference between CLIENT and AUTO_ACKNOWLEDGE modes" Watch "JMS:Difference between CLIENT and AUTO_ACKNOWLEDGE modes" New topic
Author

JMS:Difference between CLIENT and AUTO_ACKNOWLEDGE modes

Vinny Menon
Ranch Hand

Joined: Jan 10, 2006
Posts: 62

Hi,
Can my fellow ranchers please throw some light on this JMS doubt:-In a pub-sub environment,
for a subscriber,what is the difference between CLIENT and AUTO ACKNOWLEDGE modes?
Also if i use the "CLIENT" mode,is it necessary to call the message.acknowledge() method? message-->TextMessage

Which one of the two is a safer mode to ensure proper delivery of messages.
Please note I am using a messageListener to listen to the messages.

thanks
cheers
vinnym.


Regards,Vinny M.
proud Fan of European Champion CHELSEA FC
"If you don't see the bug where you're looking, perhaps you're looking in the wrong place" -James Gosling
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

This article will give you some insight on the jms transactional model and acknowledgment modes.
I think, the choice of an acknowledgment mode, totally depends on what you want to do. If you want to take onus of deciding when a message is deemed to be consumed, then you must go for client ack and if you are sure that you will handle the message, no matter what comes your way, then you should do an auto acknowledgment.

Disclaimer: No one took a chance on this question so i did


apigee, a better way to API!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JMS:Difference between CLIENT and AUTO_ACKNOWLEDGE modes