Is there a standard way of doing RPCs with rabbitmq-c

235 Views Asked by At

In the RabbitMQ tutorials there's a demonstration of how to do remote process calls in all but C-languages (C, C++). I'm using rabbitmq-c and I'm close to replicating what the Python tutorial is doing, after all correlation_id and reply_to are available fields in the amq_basic_properties.

That been said, I can see the following two methods in the amqp.h header:

  • amq_simple_rpc
  • amq_simple_rpc_decoded

It's my understanding that these are used internally for the library's communication with the broker (e.g. that how a call to create a queue goes through) but I was wondering whether I can use those directly to support my own remote process calls, i.e. have a function that "lives" in one client and make it callable by another client.

If these methods can't be used like this, is there a standard alternative or a description of how to do routed RPCs with librabbitmq-c? Is my approach of replicating the pika tutorial "sane"?

1

There are 1 best solutions below

0
On

You're right in your suspicion that amq_simple_rpc etc are for low-level client-broker communication. They are indeed unsuitable for (broker-mediated) client-to-client communication.

My opinion is that your approach following the pika tutorial is sensible. I'm afraid I do not know of any standard RPC helper library for librabbitmq-c.