thank you. But I still don't know how to do it. should I use CLIENT_ACKNOWLEDGE?after the client really done my job, the client send acknowledge?
Message message = consumer.receive(); do thing thing time consuming successfully message.acknowledge(); How can I prevent a message is consumed by two consumers? for example, consumer 1 do something with message 1 successfully but the network is disconnected before call message.acknowledge and the message is sent to consumer 2 and is processed again. another problem: if I use AUTO_ACKNOWLEDGE, when it's acknowedged in the onMessage method? e.g. public void onMessage(Message message) { call long_time_method(); } ack is before long_time_method or after it? On Sun, Dec 29, 2013 at 4:36 AM, Christian Posta <christian.po...@gmail.com> wrote: > check out this great blog post by Raul: > http://blog.raulkr.net/2012/08/consumer-acknowledgements-in-activemq.html > > On Thu, Dec 26, 2013 at 11:52 PM, Li Li <fancye...@gmail.com> wrote: >> hi all, >> activemq ensure a message sent to a queue will be consumed by >> exactly one consumer. But what happens when the consumer receive this >> message and crash and don't do anything with this message. How can I >> ensure the consumer really did his job? how to ensure if the consumer >> crashed, the message will be sent to another consumer. > > > > -- > Christian Posta > http://www.christianposta.com/blog > twitter: @christianposta