You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by fred <fl...@netratings.com> on 2006/10/11 19:28:41 UTC

processed message from a dead consumer are reassigned

I am newer for ActiveMQ. 

Over here, I have a question on why processed messages by a dead consumer(I
intentionally killed it after it processed messages) are reassigned to other
alive consumers and these messages are reprocessed.

I just use the exmple producer and consumer going along with the download
package. Register 3 conumers and 1 producer to the queue, and set
Session.AUTO_ACKNOWLEDGE when creating sessions

Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);

After consumer1 received and processed 9 messages, I killed it. However, I
found these 9 messages will be reassigned to alive consumer2 and consumer3.
This is redoing the process on these 9 messages. 

Anyone have ideas on how to avoid these processed messages get reassigned to
other consumers?

Thanks in advance

Fred
-- 
View this message in context: http://www.nabble.com/processed-message-from-a-dead-consumer-are-reassigned-tf2424919.html#a6760993
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: processed message from a dead consumer are reassigned

Posted by V Lavilla <va...@simulalabs.com>.
Hi fred,

I tried to replicate your problem, but no luck. Here's what I did:

1. used the example producer/consumer in the binary distribution. messages
are distributed to the registered consumers. No message was resent after a
message has been consumed/acknowledged.
2. tried setting an exclusive consumer (description in this site:
http://activemq.org/site/exclusive-consumer.html). After receiving 9messages
i terminated it. messages were successfully consumed and was not reassigned
to other consumers.

It would be great if you can post your client code and settings (if you've
used other settings). 

BTW, I used amq 4.0.1.

Val


fred wrote:
> 
> Hi,
> 
> I find to use mode Session.CLIENT_ACKNOWLEDGE in session creation, and
> call message.acknowledge() explicitly in consumer's onMessage. In this
> way, messages processed by intentionally killed consumer will not be
> reassigned to other alive consumers.
> 
> I am wondering why Session.AUTO_ACKNOWLEDGE mode is not able to notify
> Queue automatically for each processed message. Mabye there is time lapse
> for this purpose? 
> 
> 
> 
> 
> fred wrote:
>> 
>> 
>> 
>> fred wrote:
>>> 
>>> I am newer for ActiveMQ. 
>>> 
>>> Over here, I have a question on why processed messages by a dead
>>> consumer(I intentionally killed it after it processed messages) are
>>> reassigned to other alive consumers and these messages are reprocessed.
>>> 
>>> I just use the exmple producer and consumer going along with the
>>> download package. Register 3 conumers and 1 producer to the queue, and
>>> set Session.AUTO_ACKNOWLEDGE when creating sessions
>>> 
>>> Session session =
>>> connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
>>> 
>>> After consumer1 received and processed 9 messages, I killed it. However,
>>> I found these 9 messages will be reassigned to alive consumer2 and
>>> consumer3. This is redoing the process on these 9 messages. 
>>> 
>>> Anyone have ideas on how to avoid these processed messages get
>>> reassigned to other consumers?
>>> 
>>> Thanks in advance
>>> 
>>> Fred
>>> 
>> 
>> 
> 
> 



-- 
View this message in context: http://www.nabble.com/processed-message-from-a-dead-consumer-are-reassigned-tf2424919.html#a6851866
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: processed message from a dead consumer are reassigned

Posted by fred <fl...@netratings.com>.
Hi,

I find to use mode Session.CLIENT_ACKNOWLEDGE in session creation, and call
message.acknowledge() explicitly in consumer's onMessage. In this way,
messages processed by intentionally killed consumer will not be reassigned
to other alive consumers.

I am wondering why Session.AUTO_ACKNOWLEDGE mode is not able to notify Queue
automatically for each processed message. Mabye there is time lapse for this
purpose? 




fred wrote:
> 
> 
> 
> Adrian Co wrote:
>> 
>> Hi,
>> 
>> I wonder if you can post your client code. I find this behavior quite
>> odd. :)
>> 
>> 
>> 
>> fred wrote:
>>> 
>>> I am newer for ActiveMQ. 
>>> 
>>> Over here, I have a question on why processed messages by a dead
>>> consumer(I intentionally killed it after it processed messages) are
>>> reassigned to other alive consumers and these messages are reprocessed.
>>> 
>>> I just use the exmple producer and consumer going along with the
>>> download package. Register 3 conumers and 1 producer to the queue, and
>>> set Session.AUTO_ACKNOWLEDGE when creating sessions
>>> 
>>> Session session =
>>> connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
>>> 
>>> After consumer1 received and processed 9 messages, I killed it. However,
>>> I found these 9 messages will be reassigned to alive consumer2 and
>>> consumer3. This is redoing the process on these 9 messages. 
>>> 
>>> Anyone have ideas on how to avoid these processed messages get
>>> reassigned to other consumers?
>>> 
>>> Thanks in advance
>>> 
>>> Fred
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/processed-message-from-a-dead-consumer-are-reassigned-tf2424919.html#a6784336
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: processed message from a dead consumer are reassigned

Posted by fred <fl...@netratings.com>.


Adrian Co wrote:
> 
> Hi,
> 
> I wonder if you can post your client code. I find this behavior quite odd.
> :)
> 
> 
> 
> fred wrote:
>> 
>> I am newer for ActiveMQ. 
>> 
>> Over here, I have a question on why processed messages by a dead
>> consumer(I intentionally killed it after it processed messages) are
>> reassigned to other alive consumers and these messages are reprocessed.
>> 
>> I just use the exmple producer and consumer going along with the download
>> package. Register 3 conumers and 1 producer to the queue, and set
>> Session.AUTO_ACKNOWLEDGE when creating sessions
>> 
>> Session session =
>> connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
>> 
>> After consumer1 received and processed 9 messages, I killed it. However,
>> I found these 9 messages will be reassigned to alive consumer2 and
>> consumer3. This is redoing the process on these 9 messages. 
>> 
>> Anyone have ideas on how to avoid these processed messages get reassigned
>> to other consumers?
>> 
>> Thanks in advance
>> 
>> Fred
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/processed-message-from-a-dead-consumer-are-reassigned-tf2424919.html#a6784212
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: processed message from a dead consumer are reassigned

Posted by Adrian Co <ac...@exist.com>.
Hi,

I wonder if you can post your client code. I find this behavior quite odd.
:)



fred wrote:
> 
> I am newer for ActiveMQ. 
> 
> Over here, I have a question on why processed messages by a dead
> consumer(I intentionally killed it after it processed messages) are
> reassigned to other alive consumers and these messages are reprocessed.
> 
> I just use the exmple producer and consumer going along with the download
> package. Register 3 conumers and 1 producer to the queue, and set
> Session.AUTO_ACKNOWLEDGE when creating sessions
> 
> Session session =
> connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
> 
> After consumer1 received and processed 9 messages, I killed it. However, I
> found these 9 messages will be reassigned to alive consumer2 and
> consumer3. This is redoing the process on these 9 messages. 
> 
> Anyone have ideas on how to avoid these processed messages get reassigned
> to other consumers?
> 
> Thanks in advance
> 
> Fred
> 

-- 
View this message in context: http://www.nabble.com/processed-message-from-a-dead-consumer-are-reassigned-tf2424919.html#a6784082
Sent from the ActiveMQ - User mailing list archive at Nabble.com.