<div dir="ltr">Hi Steve,<div><br></div><div>Is EnqueueItem called repeatedly? I would move all of the connection creation code out of this function, and instead maintain the connection as a long lived instance.</div><div><br>
</div><div>--Jon</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 23, 2014 at 5:51 AM, Steve T <span dir="ltr"><<a href="mailto:ssteo@roboqa.com" target="_blank">ssteo@roboqa.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Sorry for sending to this mail list, not sure if this is the right channel to report this issue.</div>
<div><br></div><div>I'm using RabbitMQ .NET client 3.2.3 with RabbitMQ 3.2.3 but encountering some random errors thrown from within the client itself. The error below happens very occassionally during item publishing via my own function <span style="font-family:arial,sans-serif">EnqueueItem();</span></div>
<div><span style="font-family:arial,sans-serif"><br></span></div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">Stack Trace:</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">System.Net.Sockets.</span><span style="font-family:arial,sans-serif;font-size:13px">SocketException: The descriptor is not a socket</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> at System.Net.Sockets.Socket.</span><span style="font-family:arial,sans-serif;font-size:13px">SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> at System.Net.Sockets.TcpClient.</span><span style="font-family:arial,sans-serif;font-size:13px">set_ReceiveTimeout (Int32 value)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> at RabbitMQ.Client.Impl.</span><span style="font-family:arial,sans-serif;font-size:13px">SocketFrameHandler_0_9.set_</span><span style="font-family:arial,sans-serif;font-size:13px">Timeout (Int32 value)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> at RabbitMQ.Client.Impl.</span><span style="font-family:arial,sans-serif;font-size:13px">ConnectionBase.ClosingLoop ()</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">My code is fairly straightforward, shown below:</span></div><div>
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"> private static void EnqueueItem(string queue, string json)</font></div>
<div><font face="arial, sans-serif"> {</font></div><div><font face="arial, sans-serif"> ConnectionFactory connectionFactory = new ConnectionFactory()</font></div><div><font face="arial, sans-serif"> {</font></div>
<div><font face="arial, sans-serif"> HostName = ROBOQA_RABBITMQ_HOSTNAME,</font></div><div><font face="arial, sans-serif"> UserName = ROBOQA_RABBITMQ_USERNAME,</font></div><div><font face="arial, sans-serif"> Password = ROBOQA_RABBITMQ_PASSWORD</font></div>
<div><font face="arial, sans-serif"> };</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"> using (IConnection iconnection = connectionFactory.CreateConnection())</font></div>
<div><font face="arial, sans-serif"> {</font></div><div><font face="arial, sans-serif"> using (IModel channel = iconnection.CreateModel())</font></div><div><font face="arial, sans-serif"> {</font></div>
<div><font face="arial, sans-serif"> channel.QueueDeclare(queue, true, false, false, null);</font></div><div><font face="arial, sans-serif"> IBasicProperties properties = channel.CreateBasicProperties();</font></div>
<div><font face="arial, sans-serif"> properties.SetPersistent(true);</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"> channel.BasicPublish(String.Empty, queue, properties, Encoding.UTF8.GetBytes(json));</font></div>
<div><font face="arial, sans-serif"> }</font></div><div><font face="arial, sans-serif"> }</font></div><div><font face="arial, sans-serif"> }</font></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div></div><div style="font-family:arial,sans-serif;font-size:13px">Will be great if anyone can let me know if there is a problem with the way I use it or maybe a bug in the client driver itself?</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks,</div><div style="font-family:arial,sans-serif;font-size:13px">Steve.</div></div>
<br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>