--
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.
Your RPC servers should reply to the message aggregator queue, not to the same fanout exchange.
On Thu, Aug 21, 2014 at 11:01 AM, Asadullah Hussain <asad...@gmail.com> wrote:
I tried using the RPC design from the tutorial to simply send a string "Hello" and receive it's reply "Reply". I am able to send the message & receive reply but here are a few design questions:
0. The client code to wait for the reply is :
while response is None:
connection.process_data_events()
return str(response)But even after the reply messages are received i.e., channel.basic_consume calls it's callback function. The "return str(response)" statement is not executed.
What may be the problem with the above code?1. In the tutorial for RPC, the client (sender) only declares the callback queue (doesn't bind it because it is default exchange). I have to bind the call_back queue to exchange.Now this causes a problem the exchange broadcasts all messages to all "binded queues" which means that both client & server receive both "Hello" & "Reply" messages.How can I ensure that the client only receives "Reply" & server only receives "Hello"
--Cheers,Asadullah Hussain
Let me see if I understand this correctly.Let's say we have queues A, B, C bound to a fanout exchange. Consumers to those queues are your RPC servers.Your client will send one message to the fanout exchange, so A, B and C will get the message, they will do something with it, and they they will have to reply back. That message will have a reply_to property set to "client_queue" and a correlation_id, for example "1" for the first request, "2" for the second request, and so on.Your client will then wait for tree different replies (ones from each server), once it get the replies, it aggregates them, and do something with the aggregated data.How does it know those three replies must be aggregated together? All three replies come with the same correlation_id.
How do the RPC servers know where to reply? They check the reply_to property of the messages.Is this what you want to implement?