[rabbitmq-discuss] Connection getting closed
Tim Yen
tim.yen at gmail.com
Tue Sep 13 00:56:25 BST 2011
Hi,
Has anyone else run into this exception?
The AMQP operation was interrupted: AMQP close-reason, initiated by Library,
code=541, text="Unexpected Exception", classId=0, methodId=0,
cause=System.IO.IOException: Unable to read data from the transport
connection: An established connection was aborted by the software in your
host machine. ---> System.Net.Sockets.SocketException: An established
connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset,
Int32 size)
--- End of inner exception stack trace ---
at RabbitMQ.Client.Impl.Frame.ReadFrom(NetworkBinaryReader reader)
at RabbitMQ.Client.Impl.SocketFrameHandler_0_9.ReadFrame()
at RabbitMQ.Client.Impl.ConnectionBase.MainLoopIteration()
at RabbitMQ.Client.Impl.ConnectionBase.MainLoop()
I declare my exchange and queue as such, I'm using the .net client.
ConnectionFactory factory = new ConnectionFactory();
factory.UserName = settings.UserName;
factory.Password = settings.Password;
factory.HostName = settings.HostIp;
factory.VirtualHost = "data_loading";
factory.Port = AmqpTcpEndpoint.UseDefaultPort;
factory.Protocol = Protocols.AMQP_0_9_1;this.connection =
factory.CreateConnection();this.model =
this.connection.CreateModel();this.model.ExchangeDeclare(MonitoringExchange,
ExchangeType.Topic, true, false,
null);this.model.QueueDeclare(EventMessagesQueueName, true, false,
false, null);this.model.QueueBind(EventMessagesQueueName,
MonitoringExchange, this.messageRoutingKey, null);
and the publish that raises the exception is
this.model.BasicPublish(MonitoringExchange, this.messageRoutingKey,
null, bytes);
The connection is kept open from the start of the program until the exit,
which will probably be days, but it seems to happen after a few minutes.
I haven't timed it yet.
Do I have to recycle connections every so often?
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110913/068e8f4e/attachment.htm>
More information about the rabbitmq-discuss
mailing list