[rabbitmq-discuss] Timeout for hung connection on rabbitmq server?

Andrew McGill list2012 at lunch.za.net
Mon Aug 13 13:08:09 BST 2012


Hi rabbitmq list folks,

I have a rabbitmq client on a dynamic IP address.  This client connects to a rabbitmq server, and the connection is in ESTABLISHED state.  Some time later, the IP address of the client changes (without prior notice to the client), and the client makes a new connection to the rabbitmq server.  The trouble is that messages for the queue are sent to the OLD IP address, which is pretty much a black hole.  As far as the rabbitmq server is concerned nothing has occurred to indicate that the connection is down.  This situation seems to persist for quite a long time (at least 20 minutes) until some kind of timeout happens on the server.  

 * Is there a way to set the timeout value for a failed keepalive (assuming keepalive packets are in fact being sent... I see the default tcp timeout for Linux is two hours + 11 minutes, which is not quite what I need.)

 * Alternatively, is there something in this configuration which will stop keepalive from noticing that a connection has died?  (e.g. something to do with the SSL connection parameters?) 

 * Even more alternatively, is there some way that the newest client connection can identify itself as the best and most suitable instance of itself when it makes the new connection?  

If it makes any difference, the client software is AMQPlib for PHP, using SSL.

The server rabbitmq config says:

[
  {rabbit, [
    {tcp_listeners,[]},
    {tcp_listen_options, [binary,
                     {packet, raw},
                     {reuseaddr, true},
                     {backlog, 128},
                     {nodelay, true},
                     {exit_on_close, false},
                     {keepalive, true}]},
    {ssl_listeners,[5671]},
    {ssl_options, [{cacertfile,"/etc/rabbitmq/ca.crt"},
                    {certfile,"/etc/rabbitmq/rmq.crt"},
                    {keyfile,"/etc/rabbitmq/rmq.rsakey"},
                    {verify,verify_peer},
                    {keepalive, true},
                    {fail_if_no_peer_cert,true}]}
  ]}
].

&:-)


More information about the rabbitmq-discuss mailing list