On 07/01/2013 11:02 PM, jbelch wrote:
Also, is there a good
example of C++ client code that would automatically reconnect?  We currently
have logic to catch exceptions and reconnect based on these exceptions, but
we were thinking it would be cleaner if we could use the reconnect logic
that Qpid supports.

There isn't a specific example, but there is not much to it. You just need to turn on the reconnect option. You can try it out with the spout and drain examples. E.g.

 spout --connection-options '{reconnect:True}' amq.fanout

Then b0ounce the broker and watch it reconnect.

Other connection options to more finely control the reconnect logic are:

* reconnect_timeout: seconds (give up and report failure after specified
time)

* reconnect_limit: n (give up and report failure after specified number
of attempts)

* reconnect_interval_min: seconds (initial delay between failed
reconnection attempts)

* reconnect_interval_max: seconds (maximum delay between failed
reconnection attempts)

* reconnect_interval: shorthand for setting the same
reconnect_interval_min/max

* reconnect_urls: list of alternate urls to try when connecting


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to