[rabbitmq-discuss] RabbitMQ .NET client 3.2.3 bug?

Jonathan Holland joneholland at gmail.com
Sun Feb 23 18:22:34 GMT 2014


Hi Steve,

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.

--Jon




On Sun, Feb 23, 2014 at 5:51 AM, Steve T <ssteo at roboqa.com> wrote:

> Hi,
>
> Sorry for sending to this mail list, not sure if this is the right channel
> to report this issue.
>
> 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
> EnqueueItem();
>
>
> Stack Trace:
> System.Net.Sockets.SocketException: The descriptor is not a socket
>   at System.Net.Sockets.Socket.SetSocketOption (SocketOptionLevel
> optionLevel, SocketOptionName optionName, Int32 optionValue)
>   at System.Net.Sockets.TcpClient.set_ReceiveTimeout (Int32 value)
>   at RabbitMQ.Client.Impl.SocketFrameHandler_0_9.set_Timeout (Int32 value)
>   at RabbitMQ.Client.Impl.ConnectionBase.ClosingLoop ()
>
>
> My code is fairly straightforward, shown below:
>
>
>         private static void EnqueueItem(string queue, string json)
>         {
>             ConnectionFactory connectionFactory = new ConnectionFactory()
>             {
>                 HostName = ROBOQA_RABBITMQ_HOSTNAME,
>                 UserName = ROBOQA_RABBITMQ_USERNAME,
>                 Password = ROBOQA_RABBITMQ_PASSWORD
>             };
>
>             using (IConnection iconnection =
> connectionFactory.CreateConnection())
>             {
>                 using (IModel channel = iconnection.CreateModel())
>                 {
>                     channel.QueueDeclare(queue, true, false, false, null);
>                     IBasicProperties properties =
> channel.CreateBasicProperties();
>                     properties.SetPersistent(true);
>
>                     channel.BasicPublish(String.Empty, queue, properties,
> Encoding.UTF8.GetBytes(json));
>                 }
>             }
>         }
>
> 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?
>
> Thanks,
> Steve.
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140223/2b9a8111/attachment.html>


More information about the rabbitmq-discuss mailing list