On 02/01/2011 09:08 AM, Grzegorz Swiatek wrote:
does the C++ code support failover?
Yes, but it uses a different URL scheme to the java client and also requires that you explicitly enable reconnection by setting the 'reconnect' connection option to true.
I tried my own client with following URL, but got an error: Invalid URL: amqp://guest:guest@localhost/development?brokerlist='10.220.11.33;10.220.11.35;10.220.11.36'&failover='roundrobin' (qpid/Url.cpp:237) My Java client works fine with this URL.
That url scheme is peculiar to the java client. The c++ client reconises simple urls of the form hostname:port, or the url scheme defined in section 9.1.2 of the AMQP 0-10 specification (e.g. amqp:tcp:host1:port1,tcp:host2:port2)
After enabling reconnect, you can set the list of brokers to connect to either through the reconnect-urls connection option (takes a list of urls) or by utilising the AMQP scheme's ability to specify multiple hosts in a single url.
[You can also use an instance of qpid::messaging::FailoverUpdates to listen for cluster membership changes via the mechanism defined in section 11.1.2.3 of the 0-10 specification and keep the reconnect-urls on a connection up to date.]
This - i.e. the variety of urls supported - is an area in which we need need to move towards more consistency in my opinion however.
--------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
