<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 14 (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;}
@font-face
        {font-family:Serif-Roman;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
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:612.0pt 792.0pt;
        margin:3.0cm 1.0cm 2.0cm 3.0cm;}
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=LT link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'>Same thing with Exchange. Look at the Subscription.cs source:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:LT'>public</span><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:LT'> <span style='color:blue'>void</span> Bind(<span style='color:blue'>string</span> exchangeName, <span style='color:blue'>string</span> exchangeType, <span style='color:blue'>string</span> routingKey)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:LT'> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:LT'> m_model.ExchangeDeclare(exchangeName, exchangeType);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:LT'> m_model.QueueBind(m_queueName, exchangeName, routingKey, <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 style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:LT'> }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'>If I use other exchange than default (non-passive, non-durable, non-autodelete, and non-internal) I got the exception.</span><span style='font-size:9.0pt;font-family:"Serif-Roman","serif";mso-fareast-language:LT'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Serif-Roman","serif";mso-fareast-language:LT'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:LT'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:LT'> 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 5:51 PM<br><b>To:</b> rabbitmq-discuss@lists.rabbitmq.com<br><b>Subject:</b> [rabbitmq-discuss] .net client and Subscription<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-GB>Hi. As from 1.8 there is queue equivalence verification I started getting exception when I declare queue and later use it with Subscription class.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'>ch.QueueDeclare(clientID, <span style='color:blue'>false</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 style='font-size:9.5pt;font-family:Consolas'>var sub = <span style='color:blue'>new</span> <span style='color:#2B91AF'>Subscription</span>(ch, clientID, <span style='color:blue'>false</span>, RabbitMQexchange, RabbitMQexchangeType, <span style='color:#A31515'>""</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>As you can see I declare queue with Autodelete flag set to TRUE.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>But if I specify queue name, Subscriber tries to re-declare this queue with autodelete set to FALSE and exception rises.<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>Check the code from the client source:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> <span style='color:blue'>public</span> Subscription(IModel model, <span style='color:blue'>string</span> queueName, <span style='color:blue'>bool</span> noAck)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> m_model = model;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> <span style='color:blue'>if</span> (queueName == <span style='color:blue'>null</span> || queueName.Equals(<span style='color:#A31515'>""</span>)) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> m_queueName = m_model.QueueDeclare();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> m_shouldDelete = <span style='color:blue'>true</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.5pt;font-family:Consolas'> } <span style='color:blue'>else</span> {<o:p></o:p></span></b></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.5pt;font-family:Consolas'> m_queueName = m_model.QueueDeclare(queueName);<o:p></o:p></span></b></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.5pt;font-family:Consolas'> m_shouldDelete = <span style='color:blue'>false</span>;<o:p></o:p></span></b></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.5pt;font-family:Consolas'> }<o:p></o:p></span></b></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> m_consumer = <span style='color:blue'>new</span> QueueingBasicConsumer(m_model);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> m_consumerTag = m_model.BasicConsume(m_queueName, m_noAck, <span style='color:blue'>null</span>, m_consumer);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> m_latestEvent = <span style='color:blue'>null</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> }<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>Is this expected behaviour? What if I want to subscribe to autodelete queue using Subscribtion class and specifying the name of the queue?<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 style='mso-fareast-language:LT'>Best regards<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:LT'>Andrius Norkaitis<o:p></o:p></span></p></div></body></html>