Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveMQ Session AUTO_ACKNOWLEDGE property impact

Can anyone please explain me what is the impact of Session.AUTO_ACKNOWLEDGE for ActiveMQ JMS configurations

session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
like image 242
Aryan Avatar asked Jun 12 '12 07:06

Aryan


1 Answers

I believe by default ActiveMQ is set to auto acknowledge messages. This just means that when a message arrives it will automatically acknowledge that the message arrived. It is the same thing as calling .acknowledge() from the JMS object.

One reason to turn auto-acknowledge off is if you built a server and lets say you are processing each JMS Message and are doing some sort of DB transaction. If the transaction fails you would want the JMS message to be re-sent so you can fix your error and process it again. So in this sense you would only acknowledge the JMS object only after processing.

like image 161
george_h Avatar answered Oct 07 '22 22:10

george_h