rabbitmq-c icon indicating copy to clipboard operation
rabbitmq-c copied to clipboard

Add rpc_server example

Open alanxz opened this issue 8 years ago • 7 comments

alanxz avatar Dec 24 '16 01:12 alanxz

Hello alanxz, well I've implemented rabbitmq-c , and work fine except for rpc-server. I need to create a type RPC from Java(Client RPM) to client in C(Server RPC), in this moment I implemented:

Java client basic_publish RPC ------> RabbitMQ --------> Rabbit-C Consume(amqp_listen.c)

I can read request from Java but I need return a response for the queue (amq.gen.XXXXXX) and
How do I do that ?

Thanks for the API.

wallkietallkie avatar Mar 14 '17 03:03 wallkietallkie

Once you've consumed a message and processed it, your code should publish to the default exchange (amqp_empty_bytes), with a routing key that is specified in the reply_to header in the request message. Additionally your code should set the correlation_id header to be the same as what is in the request message.

alanxz avatar Mar 21 '17 03:03 alanxz

A lot of thanks Alanxz , my rpc-server implementation was successful:

https://github.com/alanxz/rabbitmq-c/compare/master...wallkietallkie:patch-1

Regards

wallkietallkie avatar Apr 01 '17 06:04 wallkietallkie

Hi alanxz, actually I do not see any rpc_server file on the example folder, only one rpc_sendstrings file,. Is that you remove the rpc_server example to the other place? Thanks~

rheerila avatar Jun 27 '17 18:06 rheerila

@rheerila there currently is no rpc_server example, this issue tracks adding this.

alanxz avatar Jul 07 '17 05:07 alanxz

@alanxz So that's mean the driver currently still not support create rpc_server right?

dhthong92 avatar Apr 03 '18 08:04 dhthong92

@dhthong92 the library supports creation of a rpc-server, however there is no example provided describing how to do so.

alanxz avatar Apr 03 '18 15:04 alanxz