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.
