[rabbitmq-discuss] Rabbitmq-C amqp_basic_publish crash on connection loss
Shashank.Lothe at techmahindra.com
Wed Oct 9 13:56:59 BST 2013
Thanks for your earlier prompt replies. I am simulating a situation to test amqp_basic_publish. I modified the amqp_sendstring example to publish a message to the broker every 3 seconds. While the messages are getting published, I stop the broker using "rabbitmqctl stop_app". As the broker is stopped, amqp_basic_publish is crashed.
Code snippet as follows.
struct timeval t;
t.tv_sec = 3;
t.tv_usec = 0;
select(0, NULL, NULL, NULL, &t);
props._flags = AMQP_BASIC_CONTENT_TYPE_FLAG | AMQP_BASIC_DELIVERY_MODE_FLAG;
props.content_type = amqp_cstring_bytes("text/plain");
props.delivery_mode = 2; /* persistent delivery mode */
First 2 published happened properly. After that I stopped broker. The program terminated. Considering this scenario, I would like to understand
1. if there is a way to check the connection before I publish
2. if the connection value becomes NULL, as we stop the broker.
Thanks and regards,
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss