activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GaryG <ggive...@us.ibm.com>
Subject Message Groups and multiple brokers
Date Tue, 06 Feb 2007 00:20:42 GMT

I started playing around with Message Groups and have a bunch of new
questions:

1.  If I'm understanding this correctly, Message Groups are tying groupIDs
to a specific consumer of the Queue.  However, this mapping is private to
the broker.  So, the problem I'm seeing is that if I run 2 brokers, and my
URL is something like this: 
url = "failover:(tcp://localhost:61616,tcp://localhost:62616)

Then I send a bunch of messages that are targeted for msgGroupId=1 or 2 or
3, and I have 3 consumers running.  Ideally what should happen is that each
consumer should get an equal share of messages.  And indeed I see this
behavior with only 1 broker.  But with 2 brokers, I don't see this happen,
only 1 consumer gets all the messages.   Am I missing something??  

I have persistence turned off in this case.

Does this mean that MessageGroups only work when there's only one broker,
and don't work in Master-Slave broker configuration??

2.  Similar example to the above, but only 1 broker, 3 consumers.  I start
the message sender, and start seeing the messages spread out across the
consumers.  Then I kill one of the consumers.  One of the 2 remaining
consumers picks up the slack.  All is good.

Now I turn the killed consumer back on, and herein lays the problem.  I
never see this consumer get any messages.  I've tried the suggested method
of closing the message group with this code:

System.out.println("closing messageGroupId="+msgGroupId);
      Message message = session.createTextMessage("reset");
      message.setStringProperty("JMSXGroupID", msgGroupId);
      message.setIntProperty("JMSXGroupSeq", 0);

      producer.send(message);

But even after I do this, the 3rd consumer never gets any messages, they
continue going to one of the other guys.  

So the question is...if one of the consumers dies, and then comes back
(common scenario), how do I get the broker to forward messages to him once
again??

Thanks again for the help!

-GaryG

-- 
View this message in context: http://www.nabble.com/Message-Groups-and-multiple-brokers-tf3177852.html#a8818152
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message