You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by farshad <te...@hotmail.com> on 2009/10/02 19:12:28 UTC

Distributed brokers and faiovers

Hi,

I am new to ActiveMQ and am trying to use it in a distributed way.  I
statically define my brokers as:
<networkConnectoruri="static://(tcp://host1:61616,tcp://host2:61616,tcp://host3:61616,tcp://host4:61616)"/>

And
<transportConnector name="openwire" uri="tcp://localhost:61616" />

I connect to host1 and place some messages in a queue.  I want to shut down
host1 and be able to be a producer and consumer of that same queue
connecting to a different broker.  Can I do that?  What is the failover
machanism?

Thank you in advance

-- 
View this message in context: http://www.nabble.com/Distributed-brokers-and-faiovers-tp25716906p25716906.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Distributed brokers and faiovers

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

if you use failover URI like failover:(tcp://host1:61616, tcp://host2:61616)
in your ActiveMQConnectionFactory, it will pick one of these brokers and try
to connect. If it fails (or the connection is dropped later) it will try
another one.

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Mon, Oct 5, 2009 at 9:14 PM, farshad <te...@hotmail.com> wrote:

>
> Hi Dejan,
>
> Thanks for the reply.  On the link you sent I read:
>
> "The Failover configuration syntax allows you to specify any number of
> composite uris. The Failover transport randomly chooses one of the
> composite
> URI and attempts to establish a connection to it. If it does not succeed or
> if it subsequently fails, a new connection is established to one of the
> other uris in the list."
>
> So, if I have a network of 3 brokers specifed staticaly in my config file
> and having also specified the failover:// protocol how does ActiveMQ fail
> an
> initial connection to one broker to another?  Or does it?
>
> I use an ActiveMQConnectionFactory which needs to be connected to a broker
> URL specifically.  So, if that broker is down do I need to try a different
> broker myself or does ActiveMQ's failover would connect to a different
> broker?  If so, how?
>
> Thanks,
> Farshad
>
>
>
> Dejan Bosanac wrote:
> >
> > Hi,
> >
> > check out failover transport
> > http://activemq.apache.org/failover-transport-reference.html
> >
> > Cheers
> > --
> > Dejan Bosanac - http://twitter.com/dejanb
> >
> > Open Source Integration - http://fusesource.com/
> > ActiveMQ in Action - http://www.manning.com/snyder/
> > Blog - http://www.nighttale.net
> >
> >
> > On Fri, Oct 2, 2009 at 7:12 PM, farshad <te...@hotmail.com> wrote:
> >
> >>
> >> Hi,
> >>
> >> I am new to ActiveMQ and am trying to use it in a distributed way.  I
> >> statically define my brokers as:
> >>
> >>
> <networkConnectoruri="static://(tcp://host1:61616,tcp://host2:61616,tcp://host3:61616,tcp://host4:61616)"/>
> >>
> >> And
> >> <transportConnector name="openwire" uri="tcp://localhost:61616" />
> >>
> >> I connect to host1 and place some messages in a queue.  I want to shut
> >> down
> >> host1 and be able to be a producer and consumer of that same queue
> >> connecting to a different broker.  Can I do that?  What is the failover
> >> machanism?
> >>
> >> Thank you in advance
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Distributed-brokers-and-faiovers-tp25716906p25716906.html
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > -----
> > Dejan Bosanac
> >
> > Open Source Integration - http://fusesource.com/
> > ActiveMQ in Action - http://www.manning.com/snyder/
> > Blog - http://www.nighttale.net
> >
>
> --
> View this message in context:
> http://www.nabble.com/Distributed-brokers-and-faiovers-tp25716906p25755942.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: Distributed brokers and faiovers

Posted by farshad <te...@hotmail.com>.
Hi Dejan,

Thanks for the reply.  On the link you sent I read:

"The Failover configuration syntax allows you to specify any number of
composite uris. The Failover transport randomly chooses one of the composite
URI and attempts to establish a connection to it. If it does not succeed or
if it subsequently fails, a new connection is established to one of the
other uris in the list."

So, if I have a network of 3 brokers specifed staticaly in my config file
and having also specified the failover:// protocol how does ActiveMQ fail an
initial connection to one broker to another?  Or does it?  

I use an ActiveMQConnectionFactory which needs to be connected to a broker
URL specifically.  So, if that broker is down do I need to try a different
broker myself or does ActiveMQ's failover would connect to a different
broker?  If so, how?

Thanks,
Farshad



Dejan Bosanac wrote:
> 
> Hi,
> 
> check out failover transport
> http://activemq.apache.org/failover-transport-reference.html
> 
> Cheers
> --
> Dejan Bosanac - http://twitter.com/dejanb
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 
> 
> On Fri, Oct 2, 2009 at 7:12 PM, farshad <te...@hotmail.com> wrote:
> 
>>
>> Hi,
>>
>> I am new to ActiveMQ and am trying to use it in a distributed way.  I
>> statically define my brokers as:
>>
>> <networkConnectoruri="static://(tcp://host1:61616,tcp://host2:61616,tcp://host3:61616,tcp://host4:61616)"/>
>>
>> And
>> <transportConnector name="openwire" uri="tcp://localhost:61616" />
>>
>> I connect to host1 and place some messages in a queue.  I want to shut
>> down
>> host1 and be able to be a producer and consumer of that same queue
>> connecting to a different broker.  Can I do that?  What is the failover
>> machanism?
>>
>> Thank you in advance
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Distributed-brokers-and-faiovers-tp25716906p25716906.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -----
> Dejan Bosanac
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 

-- 
View this message in context: http://www.nabble.com/Distributed-brokers-and-faiovers-tp25716906p25755942.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Distributed brokers and faiovers

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

check out failover transport
http://activemq.apache.org/failover-transport-reference.html

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Fri, Oct 2, 2009 at 7:12 PM, farshad <te...@hotmail.com> wrote:

>
> Hi,
>
> I am new to ActiveMQ and am trying to use it in a distributed way.  I
> statically define my brokers as:
>
> <networkConnectoruri="static://(tcp://host1:61616,tcp://host2:61616,tcp://host3:61616,tcp://host4:61616)"/>
>
> And
> <transportConnector name="openwire" uri="tcp://localhost:61616" />
>
> I connect to host1 and place some messages in a queue.  I want to shut down
> host1 and be able to be a producer and consumer of that same queue
> connecting to a different broker.  Can I do that?  What is the failover
> machanism?
>
> Thank you in advance
>
> --
> View this message in context:
> http://www.nabble.com/Distributed-brokers-and-faiovers-tp25716906p25716906.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>