activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <>
Subject Re: Questions about Networks of brokers and fail-over scenarios
Date Wed, 14 Mar 2012 10:47:25 GMT
answers inline:

On 14 March 2012 07:07, pollotek <> wrote:
> Hi all,
> I am trying to set up a fault tolerant horizontaly scalable architecture
> with ActiveMQ servers. I see that I can setup a horizontally extensible
> ActiveMQ Network of Brokers by having the consumers connect to a random
> failover broker with something like this (say start with for 2 brokers):
> failover://(tcp://broker1:61000,tcp://broker2:61000)?randomize=true
> and on the brokers configure a bridge network connector as dynamicOnly and
> low network prefetchSize on bridge connectors pointing to each other to move
> the messages from one to another.
> Given a producer connected to /broker1 /queuing messages on a persistent
> queue and consumers attached to both brokers listening for messages for the
> same queue.
> If /broker1 /goes down the consumers pointing at /broker1 /will re-balance
> to read from broker2 and the producer will automatically point to /broker2/.
> - What happens to the persistent queue messages on /broker1 /that were not
> consumed yet? I guess the messages will sit on /broker1 /until it gets
> restarted and eventually get consumed, correct?


> I guess in this scenario we lose total ordering, correct?


> - If I only had one producer queuing messages on /broker1 /and only a
> consumer on /broker2/. When will messages be forwarded to /broker2/?
Message are forwarded on demand, so once there is a remote consumer
there will be a matching local forwarding consumer

> What if a new consumer connects to /broker1 /and tries to consume from the same
> queue? Will /broker2 /stop receiving messages because somebody is consuming
> them directly on /broker1/?
no, there will just be less messages being forwarded. The consumers,
local and remote(forwarding)
compete in the normal way. It is possible to give a forwarding
consumer lower priority using
the network connector boolean attribute, decreasNetworkConsumerPriority

> What if there was no failure and instead a new producer started queuing
> messages on the same queue on /broker2/. Given that there are consumers for
> this queue attached to both brokers would any of the messages be forwarded
> across the two brokers ? Would this happen only if one of the broker runs
> out of messages for the consumers and the other one still has messages?
see above, there will still be forwarding unless

> I hope somebody can help me out to answer these very specific questions
> about these Network of Brokers fail-over scenarios
> --
> View this message in context:
> Sent from the ActiveMQ - User mailing list archive at


View raw message