[rabbitmq-discuss] Dangling Connection
tim at rabbitmq.com
Fri Dec 21 10:53:42 GMT 2012
On 21 Dec 2012, at 10:43, PSL 88506 wrote:
> 2 client instances running on same server connection to different RabbitMQ brokers.
That's not possible. You've either not explained clearly, or you've fundamentally misunderstood. "2 client instances running on [the] same server, *connected* to differed RabbitMQ brokers" would be fine, but 2 clients cannot share one connection to two different brokers. So should I assume you mean the former?
> Dangling Connection means idle connection not used for very long time.
> Say suppose, client is stopped abruptly and server is not informed, such connection should not exist. Is there any way to handle such connection i.e remove them.
If a client stops abruptly, then the connection will drop. It's certainly true that TCP/IP can take quite a long time to notice this and inform the broker! That is *exactly* what heartbeats are there for, so that after some shorter time interval, the broker will notice that there have been no heartbeats and therefore tear down the socket and release any server allocated resources. So yes, use heartbeats to ensure that connection state gets cleaned up in a timely fashion.
More information about the rabbitmq-discuss