Hi Gordon, Thanks a lot for the help.
Best Regards, Sergey Zhemzhitsky Information Technology Division Troika Dialog, 4, Romanov lane, Moscow 125009, Russia Phone. +7 495 2580500 ext. 1246 Gordon Sim <g...@redhat.com> 18.04.2011 19:52 Please respond to users@qpid.apache.org To users@qpid.apache.org cc Subject Re: C++ Client. Cluster failover. On 04/18/2011 04:03 PM, sergey_zhemzhit...@troika.ru wrote: > Hi there, > > According to the > http://qpid.apache.org/books/0.8/Programming-In-Apache-Qpid/html/ch02s14.html > we can configure a client failover by means of the following snippet of > code > > Connection connection("localhost:5672"); > connection.setOption("reconnect", true); > try { > connection.open(); > std::auto_ptr<FailoverUpdates> updates(new > FailoverUpdates(connection)); > ... > > What happens if localhost or any other host is unavailable? > > Is it possible to get failover updates and list multiple brokers in the > connection string at the same time. Yes, you can either use an AMQP 0-10 style URL: amqp:tcp:host1:5672,tcp:host2:5672 or you can use the reconnect-urls option to set a list of URLs to try on failover. That list is what the FailoverUpdates sets when it receives notification of a change in cluster membership. > What I mean is > > Connection connection("host1:5672,host2:5672"); > connection.setOption("reconnect", true); > try { > connection.open(); > std::auto_ptr<FailoverUpdates> updates(new > FailoverUpdates(connection)); > ... > > So when host1 is unavailable we will connect to the host2. When host3 > joins the cluster and host2 becomes unavailable we will receive failover > update and reconnect to the host3. > > > Best Regards, > Sergey Zhemzhitsky > _______________________________________________________ > > The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. > If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp > > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscr...@qpid.apache.org _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp