<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Mark,<br>
<br>
You should try enabling AMQP heartbeats, as this should resolve the
issue of detecting the connection is being closed. <br>
<br>
On 08/02/2012 03:58 PM, Mark Ward wrote:
<blockquote
cite="mid:a4ba58d0-0a0e-44e1-a864-93b8d0114240@googlegroups.com"
type="cite">Hi,
<div><br>
</div>
<div>I am performing tests to a server across the internet.
During the night our firewall is rebooted and it appears the
basic consumer is not detecting this and does not throw any
exceptions on the connection. When I arrive to the office each
morning the subscriber client is still running and in the block
state waiting for a message. If I send messages to the server
the client will not receive messages unless I restart the
client. The client works all day long as I push millions of
messages through for testing. It is after the firewall reset
that the client does not continue to work or fail out. This
does appear to be a repeatable issue for the past two days it
has performed this same issue. I am going to continue tonight
to see if it repeats.</div>
<div><br>
</div>
<div>Is there something I need to enable to have the client detect
the connection closure? The testing I have manually performed
on closing the network connection, shutting down the server,
restarting the server have all caused the client to properly
throw and exception that the connection was closed. It is only
when the firewall resets that the client does not detect the
failed connection. </div>
<div><br>
</div>
<div>This is the .NET client connecting to the port 5672. It is
not using SSL.</div>
<div><br>
</div>
<div>below is the example code I am working with.</div>
<div><br>
</div>
<div>
<div>var connectionFactory = new ConnectionFactory();</div>
<div> connectionFactory.HostName = hostName;</div>
<div> connectionFactory.Port = port;</div>
<div><br>
</div>
<div> IConnection connection =
connectionFactory.CreateConnection();</div>
<div> IModel channel = connection.CreateModel();</div>
<div><br>
</div>
<div> QueueingBasicConsumer consumer = new
QueueingBasicConsumer(channel);</div>
<div> String consumer_tag =
channel.BasicConsume("QueueOne", false, consumer);</div>
<div><br>
</div>
<div> Console.WriteLine("ctrl+c to exit");</div>
<div> while (true)</div>
<div> {</div>
<div> BasicDeliverEventArgs evt_args =
(BasicDeliverEventArgs)consumer.Queue.Dequeue();</div>
<div> IBasicProperties msg_props =
evt_args.BasicProperties;</div>
<div> string message =
Encoding.UTF8.GetString(evt_args.Body);</div>
<div><br>
</div>
<div> channel.BasicAck(evt_args.DeliveryTag,
false);</div>
<div><br>
</div>
<div> Console.WriteLine("Message Body: " +
message);</div>
<div> }</div>
<div><br>
</div>
<div> channel.Close();</div>
<div> connection.Close();</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rabbitmq-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>
<a class="moz-txt-link-freetext" href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a>
</pre>
</blockquote>
<br>
</body>
</html>