activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: detaching message group affinity
Date Mon, 19 Jun 2006 15:17:58 GMT
On 6/19/06, Sanjiv Jivan <sanjiv.jivan@gmail.com> wrote:
> On 6/19/06, James Strachan <james.strachan@gmail.com> wrote:
> >
> > On 6/17/06, Sanjiv Jivan <sanjiv.jivan@gmail.com> wrote:
> > > The Message Group functionality of Active MQ 4.0 is really neat. I have
> > a
> > > couple of questions regarding this
> > >
> > > 1. Is this feature fully supported/tested with the P2P discovery style
> > > broker topology? Are they any test cases or samples I can try. I looked
> > for
> > > them in the source but wasn't able to locate them. And when I tried
> > running
> > > such a scenario, I did not see a proper load balancing (even round robin
> > > style) of message groups across available brokers. When messages
> > belonging
> > > to different message groups are sent, oftentimes only one or a small
> > > percentage of running brokers are chosen as recipients. As a result I
> > end up
> > > with some brokers that are overloaded while others are sitting idle.
> >
> > Generally Message Groups only apply to the broker which you are using;
> > there is no global cross-broker load balancing. So its intended when
> > using a traditional client-broker topology rather than a peer based
> > network.
> >
> > Though I'm surprised that you are finding on a single broker it is not
> > load balancing requests across multiple brokers. Are you sure there
> > are suitable consumers on those brokers?
>
>
> Consider a scenario where there are two servers, each of which have an
> embedded broker. What I'm seeing is that when clients send messages using
> Message Groups "MG1", "MG2", "MG3" and "MG4" etc,  the messages with these
> different message groups aren't load balanced as expected. For example, MG1
> and MG2 (and sometimes even MG3) might be received by SERVER1. I was
> expected MG1 to go to SERVER1, MG2 to SERVER2, MG3 to SERVER1, MG4 to
> SERVER2 and so on.. The sample app that I uploaded with issue AMQ-760
> demonstrates this. Is this the expected behaviour? What is the message group
> based load balancing algorithm used?

The current algorithm is to lazily assign messages to groups when a
consumer is capable of receiving them. So its not a simple round
robin.


> > 2. Is there a way to detach a message group affinity to a particular
> broker.
>
> >Just set JMSXGroupSeq to zero on the last message which 'closes' the
> >message group so if another message is sent in the future with the
> >same group ID it will be reassigned to a new consumer.
>
> >message.setIntProperty("JMSXGroupSeq", 0);
>
> This would reset all the affinity of all the message groups, right?

No - just the message group for the JMSXGroupId setting.


> This
> does not help with my use case where a message group represents a
> conversation and there can be several "conversations" taking place at the
> same time.

I should have been more clear... to clear message group FOO use

message.setStringProperty("JMSXGroupID", "FOO");
message.setIntProperty("JMSXGroupSeq", 0);

-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message