<div dir="ltr">Thanks Emile,<div><br></div><div>I find a lot of assistance in your answers.�</div><div>I do use the RPC the way you mentioned and multiple clients do connect.�</div><div>but my problem is that sometimes - a new client cannot connect .�</div>
<div><br></div><div>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.</div><div><br></div><div>How come?�</div><div>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 �</div>
<div><br></div><div>� � � ch.queueDeclare(QueueName, false,false,true,null)</div><div><br></div><div>(obviously giving �different names in the first parameter for the different queues.. )</div><div>But only the first queue is sometimes deleted.�</div>
<div>I have tried to see if it happens when the last client is shut down but it is not related.�</div><div>1. When do you think it could happen?</div><div>2. Should I declare it in another way? Like changing the third parameter - autodelete to false?�</div>
<div>( �though it should never be deleted because the server app is still holding a handle to it, no?)</div><div>Any hints would be highly appreciated.</div><div><br></div><div><br><div class="gmail_quote">On Fri, Jul 15, 2011 at 12:27 PM, Emile Joubert <span dir="ltr">&lt;<a href="mailto:emile@rabbitmq.com">emile@rabbitmq.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
On 14/07/11 07:35, mysurf mail wrote:<br>
&gt; Hi,<br>
<div class="im"><br>
&gt; Can all the clients be configurated with the same queuename (&quot;&quot;) and the<br>
&gt; same routing key (the same for all)?<br>
<br>
</div>There are two queues required for an RPC call over AMQP. The first is<br>
the work queue for the service. The request published by the RPC client<br>
needs to end up in this queue and be consumed by the RPC server. The<br>
second is the callback queue. This is declared by the RPC client and<br>
receives the reply from the RPC server.<br>
<br>
When multiple RPC clients are making use of the same RPC service then<br>
they should all use the same routing key so that all requests for that<br>
service go to the same work queue. This is called RPC_QUEUE_NAME in the<br>
relevant Java tutorial:<br>
<br>
<a href="http://www.rabbitmq.com/tutorials/tutorial-six-java.html" target="_blank">http://www.rabbitmq.com/tutorials/tutorial-six-java.html</a><br>
<br>
When you make use of RpcClient in the Java client (see<br>
<br>
<a href="http://hg.rabbitmq.com/rabbitmq-java-client/file/default/src/com/rabbitmq/client/RpcClient.java" target="_blank">http://hg.rabbitmq.com/rabbitmq-java-client/file/default/src/com/rabbitmq/client/RpcClient.java</a><br>

)<br>
<br>
you will see each client declares its own callback queue, so these are<br>
not shared. If a queue is declared with an empty name then the server<br>
assigns a random name. (See the &quot;Temporary Queues&quot; explanation in the<br>
3rd tutorial.) So even if it looks like all the clients are declaring<br>
the same queue named &quot;&quot;, they are all using different callback queues.<br>
This is the recommended approach.<br>
<font color="#888888"><br>
<br>
-Emile<br>
</font></blockquote></div><br></div></div>