3 Replies Latest reply on Oct 15, 2013 9:57 AM by Andy Taylor

    How to set AMQP idle-timeout / ping frequency / TTL?

    Branden Smith Newbie

      Could anyone advise as to how to set the idle-timeout, ping frequency, or client connection TTL for AMQP connections to HornetQ?

       

      I have a HornetQ 2.4.0-beta1 stand-alone broker to which I am connecting using the Apache Qpid AMQP-client implementation of the JMS API.  My client connections are continually timing out about 1 - 2 minutes after being established, at which point the server logs the following:

       

      17:22:18,467 WARN  [org.hornetq.core.server] HQ222067: Connection failure has been detected: HQ119014: Did not receive data from /(host):63327. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=CONNECTION_TIMEDOUT]
      17:22:18,472 WARN  [org.hornetq.core.server] HQ222061: Client connection failed, clearing up resources for session 907388cd-3516-11e3-8d11-a977cd76c964
      17:22:18,479 WARN  [org.hornetq.core.server] HQ222107: Cleared up resources for session 907388cd-3516-11e3-8d11-a977cd76c964
      
      

       

      The client logs nothing; it does not seem to detect the failure.

       

      I've set all of my connection factories in hornetq-jms.xml to have the following connection-ttl and client-failure-check-period:

       

      <connection-ttl>300000</connection-ttl>
      <client-failure-check-period>2000</client-failure-check-period>
      
      

       

      I suspect, though, since I'm using the method described here to obtain the connection factory, the connection factories defined in hornetq-jms.xml may not even come into play.  (Can anyone confirm?)

       

      I posed the question to the Qpid mailing list, and received this reply:

       

      Currently the AMQP 1.0 JMS client simply accepts the heartbeat frequency requirement that is communicated to it by the server it connects to.  Since this works with other servers, my suspicion would first be that HornetQ is not properly communicating its requirements to the client (this should be sent in the idle-timeout field of the open frame).

       

      This is what I see on the client side with regard to the Open frames:

       

      SEND[(client->server)|0] : Open{containerId=clienthost(11548):1,hostname=serverhost,maxFrameSize=65536,channelMax=255}
      RECV[(server->client)|0] : Open{containerId=,hostname=}
      
      

       

      Can anyone advise as to what I would need to do to get HornetQ to communicate the idle-timeout to the client?

       

      (Message was edited by: Branden Smith) Added link to example code showing how connection factory is obtained.