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

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

Thanks Emile,

Is this ok in Rabbit v2.6.0 ? 

There is definitely a firewall/load balancer between the C# client and Rabbit Broker. I'll investigate. 


-----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