Hi Toralf,
see Programming in Apache Qpid (http://qpid.apache.org/documentation.html, 
direct link: 
http://qpid.apache.org/books/0.12/Programming-In-Apache-Qpid/pdf/Programming-In-Apache-Qpid.pdf)
 and Section 2.10. Connection Options.

Kind regards,
Pavel



----- Original Message -----
> From: "Toralf Lund" <[email protected]>
> To: [email protected]
> Sent: Wednesday, November 23, 2011 10:53:23 AM
> Subject: Re: How to avoid waiting for a very long timeout on 
> messaging::Connection::open()?
> 
> Gordon Sim wrote:
> > On 11/23/2011 09:05 AM, Toralf Lund wrote:
> >   
> >> Hello,
> >>
> >> Sometimes the host I'm connecting to via
> >> qpid::messaging::Connection
> >> turns out to be down. When this is the case, the open() call may
> >> exhibit
> >> two different kinds of behaviour, depending on the network
> >> configuration
> >> or something:
> >>
> >> 1. An exception is raised almost immediately, and a message like
> >> 2011-11-23 09:15:44 warning Connect failed: No route to host
> >> is logged.
> >> 2. An exception is raised after a *long* delay, and log message is
> >> 2011-11-23 09:25:01 warning Connect failed: Connection timed out
> >>
> >> Now, case 1) is not really much of an issue, but 2) is rather
> >> problematic because the timeout is something like 4 minutes, and I
> >> don't
> >> want to lock up my application for that long. Questions:
> >>
> >> 1. Why is it that I sometimes get "No route to host" and at other
> >> times have to wait for a timeout? Through what mechanism does the
> >> system (sometimes) know or find out directly that the remote host
> >> is missing, so that it doesn't have to wait for timeouts etc? I
> >> realise that this is more of a general sockets or TCP question
> >> than something specific to QPid or AMQP, but does anyone here
> >> know?
> >> 2. Is there any way to make the timeout for case 2) shorter? I
> >> tried
> >> setting the "reconnect-timeout" option on the connection, but this
> >> made no difference.
> >>     
> >
> > Set the heartbeat option, then the connection will abort if two
> > heartbeat intervals pass with no response from the server.
> >   
> OK, thanks. This seems to help.
> 
> Is the option documented anywhere?
> 
> - Toralf
> 
> 
> This e-mail, including any attachments and response string, may
> contain proprietary information which is confidential and may be
> legally privileged. It is for the intended recipient only. If you
> are not the intended recipient or transmission error has misdirected
> this e-mail, please notify the author by return e-mail and delete
> this message and any attachment immediately. If you are not the
> intended recipient you must not use, disclose, distribute, forward,
> copy, print or rely on this e-mail in any way except as permitted by
> the author.
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:[email protected]
> 
> 

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

Reply via email to