Hi people, I would like to share the solution for the case pointed by me yesterday.
The case was client 2 sending messages one per 2 minutes and the client 1 sending messages one per 10 seconds. So, the client 1 was generating messages to be sent to the broker more frequently. The heartbeat_timeout was configured to 30 seconds for both clients.
So, after 30 seconds the connection for the client 2 was destroyed by timeout. In this case a call to amqp_basic_publish was causing a +++ killed by SIGPIPE +++ ( Received SIGPIPE signal! Unhandled signal (13) Broken pipe), after occurring a heartbeat_timeout.
To solve this problem I have added the following instruction in my main.c:
signal(SIGPIPE, signal_handler);
...
/**
@brief signal_handler
This function handles select signals that the daemon may
receive. This gives the daemon a chance to properly shut
down in emergency situations. This function is installed
as a signal handler in the 'main()' function.
@param sig The signal received
@returns void
*/
void signal_handler(int sig) {
switch(sig) {
case SIGHUP:
syslog(LOG_WARNING, "Received SIGHUP signal.");
break;
case SIGTERM:
syslog(LOG_WARNING, "Received SIGTERM signal.");
break;
case SIGPIPE:
syslog(LOG_ERR, "Received SIGPIPE signal!");
break;
default:
syslog(LOG_WARNING, "Unhandled signal (%d) %s", sig, strsignal(sig));
break;
}
}
Now the client 2 is working very well too.
Thanks for everyone that has helped me to find the solution.
BR.
RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph:
+55 35 3471 9300 (Brasil)
________________________________________
De: Rodrigo Pimenta Carvalho
Enviado: quarta-feira, 10 de dezembro de 2014 20:26
Para:
rabbitm...@googlegroups.com
Assunto: RabbitMQ-C Amqp_Basic_Publish is failing silently depending on the network topology. Help, please.