qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: About failover
Date Mon, 15 Aug 2016 17:46:40 GMT
On 15/08/16 15:52, Chenxiong Qi wrote:
> Hi all,
>
> I searched a lot to see if qpid.proton really does not support
> failover that I'm told. When I'm looking back to qpid.proton
> documentation, I find Container.connect method, there is a argument
> urls that accepts a sequence of broker urls. Is this for the
> connection failover?

Yes. The 'reconnect' named name argument to connect will control whether 
the library will automatically try to reconnect if the underlying tcp 
socket is disconnected.

If you want to try different urls when reconnecting, you can specify a 
list of them.

> Meanwhile, I don't find any document and examples
> about how to use Container.connect, could you give some explanation?

There is a brief tutorial for the Connector:

https://qpid.apache.org/releases/qpid-proton-0.13.1/proton/python/book/tutorial.html

along with a short overview of the key classes and methods:

https://qpid.apache.org/releases/qpid-proton-0.13.1/proton/python/book/overview.html

The examples from the tutorial are available in git (or are installed 
with your proton install):

https://git1-us-west.apache.org/repos/asf/qpid-proton/repo?p=qpid-proton.git;a=tree;f=examples/python;hb=HEAD

However none of them actual show using a list of urls. I've attached one 
that does. To use it, specify multiple servers to connect to using the 
--address option, e.g.

   failover.py --address host1 --address host2

or

   failover.py --address localhost:5673 --address localhost:5674


> It would be much appreciated if you can give an example. If it's for
> failover, can it used to connect ActiveMQ in order to utilize ActiveMQ
> Failover http://activemq.apache.org/failover-transport-reference.html
> ?

There is no built in support for retrieving urls to try from any broker. 
However if you provide a list of urls, it will use them when reconnecting.


Mime
View raw message