<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:85.05pt 28.35pt 56.7pt 85.05pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span style='color:#1F497D'>Hi,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>As part of a soon to be released
project from SpringSource, we will be providing a .NET client API to access the
information you can get via Rabbitmqctl and other functions in the rabbitmq
broker. Jim Apperly from the rabbitmq team did the real hard work,
I’ll just be doing some minor changes. I’ll post back once
some code is in git here </span><code><span style='font-size:10.0pt'>git clone <a
href="git://git.springsource.org/spring-amqp/spring-amqp-net.git">git://git.springsource.org/spring-amqp/spring-amqp-net.git</a><o:p></o:p></span></code></p>
<p class=MsoNormal><code><span style='font-size:10.0pt'><o:p> </o:p></span></code></p>
<p class=MsoNormal><code><span style='font-size:10.0pt'>Mark<o:p></o:p></span></code></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
rabbitmq-discuss-bounces@lists.rabbitmq.com
[mailto:rabbitmq-discuss-bounces@lists.rabbitmq.com] <b>On Behalf Of </b>Andrius
Norkaitis<br>
<b>Sent:</b> Monday, July 05, 2010 12:44 PM<br>
<b>To:</b> rabbitmq-discuss@lists.rabbitmq.com<br>
<b>Subject:</b> [rabbitmq-discuss] how get list of queues / check queue exists<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span lang=EN-GB>Hi.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>I have occasionally connected clients
(subscribers) which bids to non-durable, exclusive, autodelete queue with their
own ID.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>I’m looking how to check which of the
clients is online (queues with known ids is available) or not.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>If I could get a list of available queues I
could compare their names with ID to know which subscribers is online.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>Also if there would be method to check is
queue available I could iterate through my list and check it.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>Rabbitmqctl has method to get list of
available queues, but I haven’t found any way doing this using client.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>I have founded one solution using
QueueDeclare and passive flag:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>
<p class=MsoNormal style='text-indent:.9in;text-autospace:none'><span lang=LT
style='font-size:9.5pt;font-family:Consolas;color:blue'>bool</span><span
lang=LT style='font-size:9.5pt;font-family:Consolas'> QueueAvailable = <span
style='color:blue'>false</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=LT style='font-size:
9.5pt;font-family:Consolas'>
<span style='color:blue'>try</span><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=LT style='font-size:
9.5pt;font-family:Consolas'>
{<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=LT style='font-size:
9.5pt;font-family:Consolas'>
<span style='color:blue'>var</span> m = ch.QueueDeclare(routingKey, <span
style='color:blue'>true</span>, <span style='color:blue'>false</span>, <span
style='color:blue'>true</span>, <span style='color:blue'>true</span>, <span
style='color:blue'>false</span>, <span style='color:blue'>null</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=LT style='font-size:
9.5pt;font-family:Consolas'>
QueueAvailable = <span style='color:blue'>true</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=LT style='font-size:
9.5pt;font-family:Consolas'>
}<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=LT style='font-size:
9.5pt;font-family:Consolas'>
<span style='color:blue'>catch</span> { }<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>If there is no queue available I get an
exception, but also this closes the connection so to check i.e. 500 queues
I’ll need to make a lot of new connections every time.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>Maybe there is more elegant solution?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>Best regards<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-GB>Andrius Norkaitis<o:p></o:p></span></p>
</div>
</div>
</body>
</html>