activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Li <>
Subject Re: how to make sure consumer correctly fullfil a task?
Date Mon, 30 Dec 2013 02:32:15 GMT
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

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?
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
<> wrote:
> check out this great blog post by Raul:
> On Thu, Dec 26, 2013 at 11:52 PM, Li Li <> 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
> twitter: @christianposta

View raw message