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

mysurf mail stammailbox at gmail.com
Mon Jul 18 10:04:03 BST 2011


Thanks Emile,

I find a lot of assistance in your answers.
I do use the RPC the way you mentioned and multiple clients do connect.
but my problem is that sometimes - a new client cannot connect .

While investigating this problem I found that one of the server RPC queues
was deleted. and when the client tries to connect to it, it halts when
trying.

How come?
I have 2 RPC queues for different services/ I declare them both in the same
way - declaring both queues for the rpcserver with this line

      ch.queueDeclare(QueueName, false,false,true,null)

(obviously giving  different names in the first parameter for the different
queues.. )
But only the first queue is sometimes deleted.
I have tried to see if it happens when the last client is shut down but it
is not related.
1. When do you think it could happen?
2. Should I declare it in another way? Like changing the third parameter -
autodelete to false?
(  though it should never be deleted because the server app is still holding
a handle to it, no?)
Any hints would be highly appreciated.


On Fri, Jul 15, 2011 at 12:27 PM, Emile Joubert <emile at rabbitmq.com> wrote:

> Hi,
>
> On 14/07/11 07:35, mysurf mail wrote:
> > Hi,
>
> > Can all the clients be configurated with the same queuename ("") and the
> > same routing key (the same for all)?
>
> There are two queues required for an RPC call over AMQP. The first is
> the work queue for the service. The request published by the RPC client
> needs to end up in this queue and be consumed by the RPC server. The
> second is the callback queue. This is declared by the RPC client and
> receives the reply from the RPC server.
>
> When multiple RPC clients are making use of the same RPC service then
> they should all use the same routing key so that all requests for that
> service go to the same work queue. This is called RPC_QUEUE_NAME in the
> relevant Java tutorial:
>
> http://www.rabbitmq.com/tutorials/tutorial-six-java.html
>
> When you make use of RpcClient in the Java client (see
>
>
> http://hg.rabbitmq.com/rabbitmq-java-client/file/default/src/com/rabbitmq/client/RpcClient.java
> )
>
> you will see each client declares its own callback queue, so these are
> not shared. If a queue is declared with an empty name then the server
> assigns a random name. (See the "Temporary Queues" explanation in the
> 3rd tutorial.) So even if it looks like all the clients are declaring
> the same queue named "", they are all using different callback queues.
> This is the recommended approach.
>
>
> -Emile
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110718/565cbb70/attachment.htm>


More information about the rabbitmq-discuss mailing list