[rabbitmq-discuss] Publishing: Connection timeout issue

Alan Antonuk alan.antonuk at gmail.com
Sat Nov 24 22:23:49 GMT 2012


Couple notes:

- Doing a connection_close() implicitly closes all channels. You don't need
to explicitly close channels.
- If you get a connection timeout error while using the connection object,
the whole connection is dead. You won't be able to do a channel_close or
connection_close. The only thing you can do is destroy the connection
object (which should clean up any memory and close any partially open
sockets).

I'm not sure how you set up your exchanges/queues on the broker, but I
don't think it should matter what connection you publish your message over.

-Alan

On Sat, Nov 24, 2012 at 4:35 PM, Borman Squirrel
<triton.genocide at gmail.com>wrote:

> 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!
>
>
> _______________________________________________
> 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/20121124/10ca5175/attachment.htm>


More information about the rabbitmq-discuss mailing list