rabbitmq-c api documentation

643 views
Skip to first unread message

Ajay Singh

unread,
Jul 13, 2015, 9:57:10 AM7/13/15
to rabbitm...@googlegroups.com
Is there a link where I can refer the API documentation which describes the expectation/behaviour of C API as there is not much comments available in the examples and I only know C/C++ so getting difficult to understand it. 
I need to implement two features 

1. RPC
2. PUB/SUB

Thanks in advance for help/suggestions. 
regards,
Ajay

Alan Antonuk

unread,
Jul 13, 2015, 2:10:08 PM7/13/15
to Ajay Singh, rabbitm...@googlegroups.com
Unfortunately documentation in rabbitmq-c is somewhat lacking.

Your best bet currently is to look at the comments in the amqp.h header file that describe the behavior of each publicly available API function.  (This is also what is parsed by Doxygen and turned into docs).

-Alan


--
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.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ajay Singh

unread,
Jul 14, 2015, 12:54:33 PM7/14/15
to rabbitm...@googlegroups.com, ajay....@gmail.com
Thanks Alan for the reply. Can you point me to a RPC server example. I got a rpc client "amqp_rpc_sendstring_client.c" under examples, but now sure what all needs to be implement for a server in C and how to run that. Is there any example I can refer for that.
I need to call a simple get/set function in form of a RPC.

 Thanks again for your help.

Regards,
Ajay

U MK

unread,
Nov 12, 2019, 4:01:29 AM11/12/19
to rabbitmq-users
Hi

Can someone share RabbitMQ-C RPC server example ?

Thanks,
Mohan

wes...@pengdrive.com

unread,
Nov 12, 2019, 4:27:19 AM11/12/19
to 'Sven Spudat' via rabbitmq-users
The RPC server is most likely business related, it's hard to share that sample code IMO.

regards.

U MK

unread,
Nov 12, 2019, 4:45:28 AM11/12/19
to rabbitmq-users
I am using RPC client  "amqp_rpc_sendstring_client".example code available in the github.

and trying to alter "amqp_listen.c" server code.

Please find the below code which I am using it for RPC server

 for (;;) {
      amqp_rpc_reply_t res;
      amqp_envelope_t envelope;

      amqp_maybe_release_buffers(conn);

      res = amqp_consume_message(conn, &envelope, NULL, 0);

      if (AMQP_RESPONSE_NORMAL != res.reply_type) {
        break;
      }

      printf("Delivery %u, exchange %.*s routingkey %.*s\n",
             (unsigned)envelope.delivery_tag, (int)envelope.exchange.len,
             (char *)envelope.exchange.bytes, (int)envelope.routing_key.len,
             (char *)envelope.routing_key.bytes);

      if (envelope.message.properties._flags & AMQP_BASIC_CONTENT_TYPE_FLAG) {
        printf("Content-type: %.*s\n",
               (int)envelope.message.properties.content_type.len,
               (char *)envelope.message.properties.content_type.bytes
   );

amqp_basic_ack(conn,1,envelope.delivery_tag,1); // added to send ACK


      }
      printf("----\n");

      amqp_dump(envelope.message.body.bytes, envelope.message.body.len);

      amqp_destroy_envelope(&envelope);
    }
  }

Any other API's I need to used to fill reply Queue, Or I am doing something wrong.

thanks,
Mohan
Reply all
Reply to author
Forward
0 new messages