[rabbitmq-discuss] Publishing: Connection timeout issue

Borman Squirrel triton.genocide at gmail.com
Sat Nov 24 21:35:42 GMT 2012


Hi everybody, carrot eaters! :)

I am using rabbitmq-c driver.

Sometimes when I try to publish a message (using basic publish method) from 
a thread that is acting like worker for sending messages, I am geting an 
error due to connection time out. 

When I try to close channel and connection to restablishing connection, I 
get broken pipe exception and consecuently I can not close the connection. 
After that, the worker enters in a new loop iteration and create a new 
socket, a new channel, a new connection ... It seems that the server, due 
to exists two connections, does not send the messages to clients through 
the right connection and the messages never reaches the clients.

This is the pseudocode :

worker_sender()
{
    while(1)
    {
         opening_socket
         logging_in
         opening_channel

         while(1)
         {
              if(error(basic_publish()) //here connection timeout error
                  break;
         }

         closing_channel //here broken pipe exception
         closing_connection //here broken pipe exception
         destroy_connection
    }
    
    return
}

It would be possible to solve this issue with other approach or some 
adjustment to the showed solution?

Thanks in advance!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121124/a1028c6a/attachment.htm>


More information about the rabbitmq-discuss mailing list