[rabbitmq-discuss] Synchronous Message Response

mp mpxr at yahoo.com.au
Tue May 10 14:05:30 BST 2011

Hi Emile,
  Thanks for the info, I actually had extended SimpleRpcServer. I had a simple override for byte[] HandleSimpleCall(...)  that's where I started to experience the issue of the client not behaving synchronously. That's why I started down the path of using BasicGet on the server.
Thanks to you clarifying that HandleSimpleCall() is what I should be using I found the bug in how I was modifying the out param 'replyProperties' incorrectly which is why the message was not being delivered.
Thanks, what I wanted to achieve here looks to be working now.

From: Emile Joubert <emile at rabbitmq.com>
To: mp <mpxr at yahoo.com.au>
Cc: rabbitmq-discuss at lists.rabbitmq.com
Sent: Tuesday, 10 May 2011 9:40 PM
Subject: Re: [rabbitmq-discuss] Synchronous Message Response


On 10/05/11 02:40, mp wrote:
> var  client  =  new  SimpleRpcClient(model, queueName)

The first thing to check is whether you need RPC. It is often possible and better to design your system in a way that the same client does not need the server response immediately.

If you do need RPC then the comments in the SimpleRpcClient and SimpleRpcServer classes provide guidance for their use.

> byte[] response;//...
> //how do I send a response?

In the server, if the request requires a response then this is provided by the return value of the HandleSimpleCall() method. If the message requires no response then HandleSimpleCast() is called instead and no response is sent.

> client side:
> //what does the client do to retrieve the ACK and RESPONSE.

Messages from the server are acknowledged internally in the SimpleRpcClient implementation. The server response is available as the return value of the Call() method.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110510/55d9768c/attachment-0001.htm>

More information about the rabbitmq-discuss mailing list