You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by agujral <an...@yahoo.com> on 2011/05/03 23:07:09 UTC

Failover configuration not working

Hi All,
         I am using the following configuration in my activemq setup 
failover:(tcp\://host1.com\:61616,tcp\://host2.com\:61616) for
producers.Brokers are running on
host1.com and host2.com . The problem is that producers always write to one
broker and the other broker is not used. As per
http://activemq.apache.org/failover-transport-reference.html  if I use
failover transport the producers should write to both brokers randomly
selecting one of them at a time.
I am using activemq 5.4 version.

Thanks
Anurag


--
View this message in context: http://activemq.2283324.n4.nabble.com/Failover-configuration-not-working-tp3493557p3493557.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Failover configuration not working

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2011-05-03 at 15:25 -0700, agujral wrote:
> Hi There,
>             Thanks for your reply.I want to accomplish the following I have
> two brokers I want my producer 
> to write use both the brokers equally.For example say there are two brokers
> A and B 
> a)Say my producer has data to write to and it writes to broker A.
> b)Now again the producer has data now producer should write to broker B and
> broker A.
> 
> I want to accomplish this so that client makes equal write requests to both
> the brokers is there a way I can accomplish this.
> 
> Thanks a lot,
> Anurag
> 

For a single producer there isn't a transport that will load balance
across brokers, the fanout transport would allows your producer to send
to both brokers at the same time.  

You might want to look into using Camel if load balancing is what you
want, Camel has a load balancer component you can use for this, see:

http://camel.apache.org/load-balancer.html

Regards


-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/

Connect at CamelOne May 24-26

The Open Source Integration Conference


Re: Failover configuration not working

Posted by agujral <an...@yahoo.com>.
Hi There,
            Thanks for your reply.I want to accomplish the following I have
two brokers I want my producer 
to write use both the brokers equally.For example say there are two brokers
A and B 
a)Say my producer has data to write to and it writes to broker A.
b)Now again the producer has data now producer should write to broker B and
broker A.

I want to accomplish this so that client makes equal write requests to both
the brokers is there a way I can accomplish this.

Thanks a lot,
Anurag


--
View this message in context: http://activemq.2283324.n4.nabble.com/Failover-configuration-not-working-tp3493557p3493755.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Failover configuration not working

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2011-05-03 at 14:34 -0700, agujral wrote:
> As per the documentation
> http://activemq.apache.org/failover-transport-reference.html randomize is
> true by default
> Then why do I need to specify it
> 

I just put it on for clarity.  To answer your question we'd need some
more details on you setup and the behavior you are seeing.


-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/

Connect at CamelOne May 24-26

The Open Source Integration Conference


Re: Failover configuration not working

Posted by agujral <an...@yahoo.com>.
As per the documentation
http://activemq.apache.org/failover-transport-reference.html randomize is
true by default
Then why do I need to specify it


--
View this message in context: http://activemq.2283324.n4.nabble.com/Failover-configuration-not-working-tp3493557p3493634.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Failover configuration not working

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2011-05-03 at 14:07 -0700, agujral wrote:
> Hi All,
>          I am using the following configuration in my activemq setup 
> failover:(tcp\://host1.com\:61616,tcp\://host2.com\:61616) for
> producers.Brokers are running on
> host1.com and host2.com . The problem is that producers always write to one
> broker and the other broker is not used. As per
> http://activemq.apache.org/failover-transport-reference.html  if I use
> failover transport the producers should write to both brokers randomly
> selecting one of them at a time.
> I am using activemq 5.4 version.

The failover transport doesn't randomly send to the different brokers,
it chooses from the list of broker, one broker to connect to, either
randomly or sequentially based on configuration.  If you have multiple
applications then you can configure the URI such that each will choose
one of the brokers at random like this:

failover:(tcp\://host1.com\:61616,tcp\://host2.com
\:61616)?randomize=true

Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/

Connect at CamelOne May 24-26

The Open Source Integration Conference