[rabbitmq-discuss] Fwd: a few json rpc questions

Michael Bridgen mikeb at rabbitmq.com
Wed Jul 13 15:53:32 BST 2011


> The RPC servers that serve requests for different applications must be
> listening on different work queues. You must ensure that RPC clients use
> a routing key that matches the server queue and are different for each
> application.
>
> and also you wrote in the last mail that I  Wouldn't need to give each
> one a different routing key ( not specifically to support multiple
> clients in answer to my second question.
>
> So, in brief. Should i give the same routing key or shouldnt i?
> can each application run with the same routing key and queue and all get
> their own answer?

By far the easiest way to encode RPC is to have one queue per service.

Many clients may make requests by publishing to that queue. Many clients 
may answer requests by consuming from that queue.

If you have disjoint services, use separate queues. To publish to a 
queue, you use the exchange "" and name the queue in the routing key.

All the rest follows.


--Michael


> On Wed, Jul 13, 2011 at 5:23 PM, Emile Joubert <emile at rabbitmq.com
> <mailto:emile at rabbitmq.com>> wrote:
>
>     Hi,
>
>     On 13/07/11 14:28, mysurf mail wrote:
>      >
>      >
>      > ---------- Forwarded message ----------
>      > From: *mysurf mail* <stammailbox at gmail.com
>     <mailto:stammailbox at gmail.com> <mailto:stammailbox at gmail.com
>     <mailto:stammailbox at gmail.com>>>
>      > Date: Wed, Jul 13, 2011 at 4:27 PM
>      > Subject: Re: [rabbitmq-discuss] a few json rpc questions
>      > To: Emile Joubert <emile at rabbitmq.com <mailto:emile at rabbitmq.com>
>     <mailto:emile at rabbitmq.com <mailto:emile at rabbitmq.com>>>
>      >
>      >
>      > Hi Emile,
>      >
>      > Thanks for the assistance.
>      >
>      > Though I have read the tutorial in your site, it looks like I did not
>      > fully understand the rpc for multiple clients' mechanism.
>
>     The RPC classes that you are using are designed to support multiple
>     clients.
>
>     I would suggest that you get RPC working reliably with a single client
>     first. The problem you describe (sometimes the application gets stuck)
>     may not relate to the presence of multiple clients at all.
>
>     The management plugin (http://www.rabbitmq.com/management.html) or the
>     rabbitmqctl utility can be used to confirm queue sizes if you believe
>     the problem is a messaging one.
>
>
>      > I have put a routing key in the server and all the clients (same one)
>      > and I thought it would make the server handle all the requests.
>      >
>      > 1. Is there any way to use the rpc like that for multiple clients?
>
>     Yes, as previously stated.
>
>      > 2. Would I need to give each one a different routing key?
>
>     No, not specifically to support multiple clients.
>
>      > 3. Would I need to use different server threads for each client?
>
>     Threading is not a relevant issue here.
>
>
>
>
>     -Emile
>
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list