activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavan Sheel <pavansh...@yahoo.com>
Subject Re: Load balancing message groups
Date Fri, 10 Nov 2006 20:16:16 GMT


Thank you James.

Ran some more tests...this is what I found:
- Setting broker dispatch policy to roundRobinDispatchPolicy was
ineffective.
- Reducing consumer.prefetchSize on ActiveMQQueue works.

Obviously , I would have liked dispatch policy to work , since the prefetch
approach does affect efficiency , and the exact settings to get even message
distribution depends on actual rates of message production & consumption.

So now I have two questions :
1) Why is setting dispatch policy not working ? (I'm using
activemq-core-4.0.1.jar)
2) How come if I do *not* set JMSXGroupID header , then the broker *is*
doing even message distribution across multiple consumers (regardless of
dispatch policy OR prefetchSize)


tx
Pavan



James.Strachan wrote:
> 
> I suspect its because you are using such a small number of messages.
> 
> http://incubator.apache.org/activemq/i-do-not-receive-messages-in-my-second-consumer.html
> 
> try setting the prefetch to 10 or something - or sending way more messages
> 
> On 11/9/06, Pavan Sheel <pavansheel@yahoo.com> wrote:
>>
>> I'm having a problem getting the message groups feature to work.
>> Essentially , I am unable to get ActiveMQ to load-balance message groups
>> across multiple queue consumers.
>>
>> I ran a set of tests...below is the observed behaviour.
>>
>> Two consumers on separate VMs , connected to a single AMQ broker via tcp
>> transport.
>> Consumers pull messages (not JCA consumers).
>> 200 messages pushed onto queue.
>> JMSXGroupID  increases from 0 - 19 , in groupsize of 10 (therefore there
>> are
>> 20 groups)
>>
>>
>> I expected delivery of these 20 groups to be load-balanced between the
>> two
>> consumers.
>> However , this is what I see :
>>
>> ·       All messages are delivered to one consumer.
>> .       Explicitly setting consumer.exclusive=false does not cause group
>> balancing (to ensure that the previous result was not because of a
>> default
>> true value).
>> ·       Slowing down consumers does not cause group balancing.
>> ·       Differentiating groupID values substantially (to ensure different
>> hashcodes) does not cause group balancing.
>> ·       Stopping active consumer midway does make broker switch to the
>> other
>> consumer.
>> ·       Eliminating JMSXGroupID header causes message balancing (ie
>> messages are
>> evenly delivered to one or the other consumer).
>> ·       Eliminating JMSXGroupID header & setting consumer.exclusive=true
>> does
>> cause broker to choose one or the other consumer for delivery of all
>> messages.
>> ·       Setting mutually exclusive selectors on each consumer does force
>> delivery
>> of some groups to one consumer and some to the other,  according to the
>> selectors (to ensure that the broker is not 'pinning' all groups to one
>> consumer)
>>
>> SUMMARY :
>> When JMSXGroupID is not set , broker does message-level load balancing 
>> (as
>> expected).
>> However - when JMSXGroupID is set , broker seems to choose one consumer
>> (constrained by selector , if any) , and delivers all messages to it (as
>> if
>> consumer.exclusive=true).
>> While this delivery behaviour is semantically safe , it is preventing me
>> from getting groups to load-balance across consumers.
>>
>> How can I get message group delivery to load-balance across multiple
>> consumers ?
>> What am I doing wrong ?
>>
>> All suggestions much appreciated -
>> Pavan Bhatnagar
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Load-balancing-message-groups-tf2599197.html#a7251011
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Load-balancing-message-groups-tf2599197.html#a7284415
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message