Hi Alan,
My system is going to run only over the Linux SO. In this case, I would like to develop a specific solution for my case.
Could you help me giving me some hints, please?
1 - How to change that long-ish timeout that the OS has that will mark the connection as broken? Is there a kind of configuration file in the SO that has the timeout value?
2 - What part of the RabbitMQ-C library code should be modified to switching rabbitmq-c to use non-blocking sockets? (In my case I don't need a portable manner).
Do you have some suggestion about what to do in the RabbitMQ-C code?
Any hint will be very helpful.
Thank you very much.
RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph:
+55 35 3471 9979 (Brasil)
________________________________________
De: Alan Antonuk [
alan.a...@gmail.com]
Enviado: segunda-feira, 22 de dezembro de 2014 19:27
Para: Rodrigo Pimenta Carvalho
Cc:
rabbitm...@googlegroups.com
Assunto: Re: [rabbitmq-users] RabbitMQ-C: Function amqp_basic_publish blocks without network link. How to avoid this behavior?
You've hit one of the limitations of the heartbeat implementation in rabbitmq-c. Currently rabbitmq-c doesn't have a way to detect that a socket will block before calling send() or recv(), thus the behavior you're seeing. If you wait long enough there is a long-ish timeout that the OS has that will mark the connection as broken and send() will return with an error.
Fixing this would require switching rabbitmq-c to use non-blocking sockets, which difficult to do in a portable manner (different OSs have different levels of support for non-blocking sockets). I do have it on a list of features I'd like to add to rabbitmq-c, but I don't have a timeline for implementing this.
-Alan
On Fri, Dec 19, 2014 at 9:50 AM, Rodrigo Pimenta Carvalho <
pim...@inatel.br<mailto:
pim...@inatel.br>> wrote:
Hi.
In my client (it is a producer and consumer) I'm using the functions: 'amqp_consume_message' and 'amqp_basic_publish'.
The client is consuming and producing messages from/to the broker perfectly.
Now, if I remove the Ethernet cable that links the client to the broker (simulating a network breakdown), I get:
A. For the consumer part (amqp_consume_message) : heartbeat timeout. The function returns and the consumer has chance to perform others tasks. Perfect!
B. For the producer part (amqp_basic_publish): It stays blocked until I plug the cable again. So, the publisher stays blocked and it cann't go ahead doing others tasks.
When I plug the cable again, the producer returns with the erro: AMQP_STATUS_SOCKET_ERROR.
How to avoid this blocking situation? I have used the same code to create the connection for producer and consumer. So, both of them use the same heartbeat timeout value configured.
Any hint will be very helpful!
Best regards.
RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph:
+55 35 3471 9300<tel:%2B55%2035%203471%209300> (Brasil)
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
rabbitmq-user...@googlegroups.com<mailto:
rabbitmq-users%2Bunsu...@googlegroups.com>.
To post to this group, send an email to
rabbitm...@googlegroups.com<mailto:
rabbitm...@googlegroups.com>.