activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <>
Subject Re: Load Balancing in ActiveMQ
Date Tue, 23 Jun 2009 14:11:14 GMT
2009/6/22 lzr <>:
> Try this way:
> Three brokers: b1, b2 and b3; with Queue named q1;
> Config networkConnectors from b1 to b2 and b3;
> For the Queue q1, run consumer application on b2 and b3; The messages put into q1 will
be dispatched to b2 and b3 in same weight.
> I tried this configuration and found it worked well.

This is a network of brokers:

In a network of brokers, messages are not load balanced across the
brokers. However, by default, ActiveMQ uses a round robin dispatch
policy so that active consumers on a destination get an equal
distribution of messages. Messages are distributed across the brokers
based on demand from active consumers on q1 on each broker. But note
that if there are no consumers on q1 on a given broker, messages will
not be distributed there.

Additionally, each consumer's prefetch limit will play a part in
message distribution as well:

perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

ActiveMQ in Action:

View raw message