[rabbitmq-discuss] .NET rabbit heartbeat to keep connections alive

Puru Belagali puru.belagali at gazprom-mt.com
Wed Mar 28 17:30:00 BST 2012

Hi Emile,

I am trying to do a force close connection on the Rabbit Web UI. I am getting this error below. The underlying tcp connection is already closed when we look at the network. 

They seem be there lying around idle since yesterday morning. We have rebooted the Rabbit box yesterday evening. How do I close these connections?

Got response code 500 with body
Internal Server Error
The server encountered an error while processing this request:



-----Original Message-----
From: Emile Joubert [mailto:emile at rabbitmq.com] 
Sent: 28 March 2012 16:59
To: Puru Belagali
Cc: rabbitmq-discuss at lists.rabbitmq.com; simon at rabbitmq.com
Subject: Re: .NET rabbit heartbeat to keep connections alive

Hi Puru,

On 28/03/12 14:52, Puru Belagali wrote:
> We are having an issue at the moment to keep connections alive between 
> the Rabbit Client and Server across 2 different sites with a 
> firewall/load balancer inbetween.
> The Fire wall/Load balancer has an ldle timer of 1 hr after which it 
> closes the underlying tcp connection if the channel is inactive for 
> over an hour.
> This is causing problems especially when the Client has a subscriber 
> listening for messages from a rabbit server behind the firewall.
> We added the connFactory.RequestedHeartbeat = 10; and tested this but 
> the connection just seems to close after 10 seconds. It doesn’t seem 
> to work. I don’t know if that’s something else needs to be enabled ?

There is nothing else that needs to be enabled - setting the value in the connection factory as you have done is correct. I'm unable to reproduce the problem you report though. Using Rabbit v2.8.1 heartbeat frames are exchanged in both directions between the broker and the C# client.

May I suggest the use of a protocol analyser or network tracer on both sides the firewall to confirm what traffic is passed between the client and the broker? The RabbitMQ Java client includes a tracer that you may find convenient for this purpose:


Wireshark includes an AMQP dissector and may also be used.


More information about the rabbitmq-discuss mailing list