Hi,<br><br>I am using the rabbitmq-c C libraries to publish messages to a Rabbitmq exchange.<br><br>Problem I have is that when rabbitmq server stops for some reason (rabbtmqctl stop_app / start_app for instance), the socket between my publisher program and rabbitmq is destroyed but I don't manage to catch any error code properly so that the program can try to establish a new connection.<br>
<br>When I stop rabbitmq, my publisher program exits with the message: "Broken Pipe" when it tries to send a message.<br><br>Is there a way to check the socket before sending a message so that I can try to re-establish a connection ?<br>
<br>The way I publish is :<br><br>rc = amqp_basic_publish(amqp_connection, 1, amqp_cstring_bytes("Exchange"), amqp_cstring_bytes(routingkey), 0, 0, NULL, body);<br><br>if (rc < 0) {<br> printf("error during publish : %s\n", strerror(-rc)) ;<br>
}<br><br>problem is that if rabbitmq is stopped, the line "rc = amqp_basic_publish ...make the program exit, I cannot get the rc value).<br><br>Thanks,<br>Regards,<br><br>Fab<br><br><br><br>