<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
p
        {margin:0}
-->
</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><b><i>We could, perhaps add a convenience method to RabbitAdmin (boolean queueExists(String queueName)).
</i></b><br>
<br>
it is an great idea&nbsp; but for a better configuration maybe not in rabbitAdmin, why? for example i don't want my application have a admin right on rabbitmq, moreoever i don't use the rabbit:admin tag because i don't need it, on AmpqTemplate object it is more
 usefull but it is a good idea!!!!<br>
<br>
<div><font size="2"><i><b>1� The queue specified on the &lt;rabbit:template/&gt; is ONLY used for the receive() methods - it is the default queue used if no queue is specified via the receive API.<br>
<br>
</b></i><font size="2">ahhhhhh ok&nbsp; bugt why <font size="2"><i><b>it is a shame!!!!</b></i></font></font></font><font size="2"><i><b><font size="2"><br>
<font color="FF0000"><b><br>
<br>
<br>
</b></font></font></b></i></font></div>
<font size="2"><i><b></b></i></font><font size="2"><i><b>2 � Like I said, you don't SEND to a queue, you send to an exchange.</b></i></font><br>
<br>
<br>
yes but not exactly....(exchange or routing key if you are in case queue connected to exchange by default).So how i can declare a exchange using spring in the code? because correct me if i do a mistake but it is an exchange or a &quot;routing key&quot; otherwise why
 it is working if y put my queue name? (direct exhange...)<br>
<br>
I don't want at all any configuration in the code beacause all my variables in spring are externalized in a conf file!!!!<br>
<br>
do you know how many device i can connect on rabbit mq maximum (consumers, iphone, android, jar....) with a good server ??? i'm sorry i've search lot of solutions befor contact you.. i wonder about the rapidity of yours responses....<br>
<br>
Thank you very much<br>
<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF134423"><font color="#000000" face="Tahoma" size="2"><b>De :</b> rabbitmq-discuss-bounces@lists.rabbitmq.com [rabbitmq-discuss-bounces@lists.rabbitmq.com] de la part de Gary Russell [grussell@vmware.com]<br>
<b>Date d'envoi :</b> vendredi 22 f�vrier 2013 18:58<br>
<b>�&nbsp;:</b> Discussions about RabbitMQ<br>
<b>Objet :</b> Re: [rabbitmq-discuss] RE : test of a existing queue<br>
</font><br>
</div>
<div></div>
<div>
<div style="font-family:tahoma,new york,times,serif; font-size:12pt; color:#000000">
We could, perhaps add a convenience method to RabbitAdmin (boolean queueExists(String queueName)).
<div><br>
</div>
<div>Feel free to open a New Feature issue:&nbsp;<a href="https://jira.springsource.org/browse/AMQP" target="_blank">https://jira.springsource.org/browse/AMQP</a></div>
<div><br>
</div>
<div><span style="font-size:12pt">The queue specified on the &lt;rabbit:template/&gt; is ONLY used for the receive() methods - it is the default queue used if no queue is specified via the receive API.</span></div>
<div><br>
</div>
<div>Like I said, you don't SEND to a queue, you send to an exchange.<br>
<br>
<hr id="zwchr">
<div style="color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<b>From: </b>&quot;Cyril LECLERC&quot; &lt;Cyril.LECLERC@pragmaconsult.lu&gt;<br>
<b>To: </b>&quot;Discussions about RabbitMQ&quot; &lt;rabbitmq-discuss@lists.rabbitmq.com&gt;<br>
<b>Sent: </b>Friday, February 22, 2013 12:00:09 PM<br>
<b>Subject: </b>[rabbitmq-discuss] RE : &nbsp;test of a existing queue<br>
<br>
<style id="owaParaStyle">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
BODY {direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;}P {margin-top:0;margin-bottom:0;}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}</style>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">thank you for your reactivity<br>
<br>
<b><i><u>channel.queueDeclarePassive(queueName) will throw an exception if the queue doesn't exist.</u></i></b><br>
<br>
Yes but the solution needs to use a Channel object, use @Inject of the factory, and it is not a boolean method so utilisation of spring amqp has no avantage and more it closes the channel connection!!!!we have to declare az new channel because spring create
 one by default plus all my consumers...for the moment my code is like this (in a wicket appplication) :<br>
<br>
&nbsp;&nbsp;&nbsp; @Inject<br>
&nbsp;&nbsp;&nbsp; <b>AmqpTemplate amqpTemplate;<br>
&nbsp;&nbsp;&nbsp; amqpTemplate.convertAndSend(&quot;queue&quot;, messageField.getValue().toString());</b><br>
<br>
my spring configuration :<br>
<br>
&lt;!-- now we can use --&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;context:property-placeholder location=&quot;${ext.properties.dir}&quot; /&gt;<br>
<br>
<b>&nbsp;&nbsp;&nbsp; &lt;rabbit:connection-factory id=&quot;rabbitConnectionFactory&quot;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; host=&quot;${config.amqp.server}&quot; username=&quot;${config.amqp.username}&quot; password=&quot;${config.amqp.password}&quot; /&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;!-- Creates a org.springframework.amqp.rabbit.core.RabbitTemplate for access
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; to the broker --&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;rabbit:template id=&quot;amqpTemplate&quot; connection-factory=&quot;rabbitConnectionFactory&quot; /&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;!-- Creates a queue for consumers to retrieve messages --&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;rabbit:queue id=&quot;queue&quot; name=&quot;${config.amqp.queuename}&quot; /&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;bean id=&quot;messageListener&quot; class=&quot;lu.pragmaconsult.geocamp.receiver.MessageHandler&quot; /&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;rabbit:listener-container<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; connection-factory=&quot;rabbitConnectionFactory&quot; concurrency=&quot;${config.amqp.nbconsumer}&quot;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; auto-startup=&quot;true&quot;&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;rabbit:listener queues=&quot;queue&quot; ref=&quot;messageListener&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/rabbit:listener-container&gt;</b><br>
<br>
<br>
If i use your advice :<br>
<br>
&nbsp;&nbsp;&nbsp; @Inject<br>
&nbsp;&nbsp;&nbsp; <b>AmqpTemplate amqpTemplate;<br>
<br>
&nbsp;&nbsp;&nbsp; </b><b><font color="FF0000">Channel channel;<br>
<font color="FF0000">&nbsp;&nbsp;&nbsp; @Inject<br>
&nbsp;&nbsp;&nbsp; ConnectionFactory rabbitConnectionFactory;</font><br>
</font><br>
&nbsp;&nbsp;&nbsp; amqpTemplate.convertAndSend(&quot;queue&quot;, messageField.getValue().toString());</b><br>
<br>
<br>
<font color="FF0000"><b>channel =(Channel) rabbitConnectionFactory.createConnection().createChannel(true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; channel.queueDeclarePassive(&quot;queue/GeoCampQueue3&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (IOException e) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated catch block<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.printStackTrace();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //maybe add the code for verify the queue&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; amqpTemplate.convertAndSend(&quot;queue/GeoCampQueue3&quot;, messageField.getValue().toString());</b></font><br>
<br>
<br>
it is not what i want moreover i want the name of queue come from spring and not in code.<br>
<br>
<br>
<b><i>No, you can't specify the queue name in the send methods - you don't send to a queue, you send to an exchange, and it routes it to the queue.</i></b><br>
<br>
if the queue is binding to the exchange by default, it is in direct so the queue name is my &quot;routing key&quot;, if i put the name of the exchange (&quot;&quot;) nothing happening<br>
<br>
i try this :<br>
<br>
<b>&nbsp;&nbsp;&nbsp; &lt;rabbit:template id=&quot;amqpTemplate&quot; connection-factory=&quot;rabbitConnectionFactory&quot; queue=&quot;queue&quot; exchange=&quot;&quot; routing-key=&quot;&quot;/&gt;</b><br>
<br>
but the exchange and routing key is like this by default, so my template don't send automatiqueliy to my queue directly by spring configuration.....<br>
<br>
have you got any id�as????<br>
&nbsp;<br>
________________________________________<br>
De : rabbitmq-discuss-bounces@lists.rabbitmq.com [rabbitmq-discuss-bounces@lists.rabbitmq.com] de la part de Gary Russell [grussell@vmware.com]<br>
Date d'envoi : vendredi 22 f�vrier 2013 17:22<br>
� : Discussions about RabbitMQ<br>
Objet : Re: [rabbitmq-discuss] test of a existing queue<br>
<br>
channel.queueDeclarePassive(queueName) will throw an exception if the queue doesn't exist.<br>
<br>
You can get a channel by<br>
<br>
Channel channel = factory.createConnection().createChannel(false);<br>
<br>
where factory is a reference to the CachingConnectionFactory.<br>
<br>
No, you can't specify the queue name in the send methods - you don't send to a queue, you send to an exchange, and it routes it to the queue.<br>
<br>
----- Original Message -----<br>
From: &quot;Cyril LECLERC&quot; &lt;Cyril.LECLERC@pragmaconsult.lu&gt;<br>
To: &quot;Discussions about RabbitMQ&quot; &lt;rabbitmq-discuss@lists.rabbitmq.com&gt;<br>
Sent: Friday, February 22, 2013 10:54:53 AM<br>
Subject: [rabbitmq-discuss] test of a existing queue<br>
<br>
Hello,<br>
<br>
How we can test if a queue exits in application? Without the queueDeclare because it is not what i want, indeed, if i use amqpTemplate.convertAndSend(), and the queue does'nt existing, nothing will happen, but i have to know if the queue configured is existing,
 but not create it...because we use spring amqp.<br>
<br>
Moreover how we can configure the name of the queue in this method (amqpTemplate.convertAndSend()) because it takes one string argument but when it is configured in spring i don't have to configure in the code i want to use spring configuration ...<br>
<br>
thanks....<br>
<br>
Cyril<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
rabbitmq-discuss@lists.rabbitmq.com<br>
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
rabbitmq-discuss@lists.rabbitmq.com<br>
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br>
<br>
--<br>
This email was Virus checked by Pragma Consult Security Gateway.<br>
</div>
<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
rabbitmq-discuss@lists.rabbitmq.com<br>
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br>
</div>
<br>
</div>
</div>
<pre>-- 
This email was Virus checked by Pragma Consult Security Gateway.</pre>
</div>
</div>
</div>
</body>
</html>