0

I am trying to use rabbitmq-c to write a program that inserts messages into a queue that already exists. The queue should have already been created by a different process. If the queue does not exist it should report an error. The program takes the name of the queue as a commandline argument. I have seen examples of the usage of the function die_on_amqp_error, for example

amqp_channel_open(conn, 1);
die_on_amqp_error(amqp_get_rpc_reply(conn), "error in opening channel");

Can this same function be used with amqp_basic_publish ? For example

amqp_basic_publish(conn, 1, amqp_cstring_bytes("amq.direct"), amqp_cstring_bytes(queue), 0, 0, &props, amqp_cstring_bytes(messagebody));
die_on_amqp_error(amqp_get_rpc_reply(conn), "error in publishing message");

I am not able to find the documentation of die_on_amqp_error here https://alanxz.github.io/rabbitmq-c/docs/0.2/index.html

Has this function been deprecated?

sriganesh
  • 19
  • 4

0 Answers0