Wednesday 15 September 2010

ActiveMQ and redelivery -



ActiveMQ and redelivery -

i have question regarding re-delivery of messages.

the setup follows:

two amq instances amq1 , amq2 (version 5.10.0) running in master/slave configuration (where amq1 master) , 2 consumers , b fetching same queue q. clients configured utilize activemqsession.individual_acknowledge , sit down in loop fetching (pull mode) messages, without acknowledging messages.

test case:

send persistent message queue q. the message consumed a. stopping amq1, brings amq2 up.

now, 1 of 2 things happens:

a) consumer receives message 1 time again results in message beingness set in dead letter queue. b) consumer b receives message , both , b has same message.

in a) problem face if crashes message lost. in b) problem 2 consumers deed on same message.

is possible configure amq somehow maintain track of re-connecting consumers, won’t re-send message if discovers nowadays @ consumer? @ to the lowest degree there should way in a) avoid having message set in dlq?

thanks!

i don't believe there's way configure activemq resend message if client reconnects because client restarted not if broker restarts or fails over. best alternative may persist in client jmsmessageid messages you've processed not ack'ed, can ignore duplicates when arrive sec time, address problem in a.

you might able utilize message groups ensure messages go same consumer (preventing scenario b), i've never used them myself i'm not sure if apply across 2 brokers in failover scenario. easy test if thought might help.

activemq

No comments:

Post a Comment