Shan Wang wrote:
I tried to set heartbeat to 5, 10, and 30 seconds, but it didn't seem to
take any effect, the failover still takes ages. Actually in
ConnectionSettings.h I found the following comments:

        /**
     * Allows a heartbeat frequency to be specified (this feature is
     * not yet implemented).
     */
    uint16_t heartbeat;

I'm using the redhat build which I believe is based on M4 version, and
the above code is from M4 source code too. I can see in trunk this has
been fully implemented now, but I expect for such a important feature
redhat should have had it in there release.

No, heartbeat support was not part of M4. (The mechanism for requesting it was which is why you see the code above).

However I think there is something else going on here. In your pstack output the client is clearly waiting for the socket to connect. The heartbeat as currently implemented won't help with that (it only takes effect after the connection has been established - in response to the Connection.Open control sent by the broker in fact).

By default he failover uses the list of known URLs and this includes retrying the original broker. However you are simulating failure, it is resulting in the socket connection attempt waiting for a long time.

To avoid that you can try the approach shown in the resuming_receiver example. I.e. implement FailoverManager::ReconnectionStrategy and rotate the original list (or indeed pop the first item off), so that you try the connect to the second broker.

(Note: you may also need to use the --cluster-url option to the broker to prevent each node advertising itself on more than one interface in which case each interface will be tried in turn).


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to