<div>I&#39;m trying to deal with connection shutdown logic as an atomic operation. �Here&#39;s the scenario I&#39;m trying to implement:</div><div><ul><li>An application has 25 subscriptions to different queues on different threads</li>
<li>The rabbitmq Windows service is restarted</li><li>The application detects a connection shutdown has occurred and performs the following actions:</li><ul><li>re-establish the connection once available</li><li>refresh each subscription with the new connection</li>
</ul></ul><div><br></div></div><div>The problem with using ModelShutdown rather than ConnectionShutdown to detect connectoin shutdowns (aside from the obvious reason) is that it doesn&#39;t really allow a client to deal with connection shutdown logic atomically. �Thinking through what I&#39;d need to do to use ModelShutdown for this scenario seems�convoluted�at best. �My particular design issues aside, don&#39;t you agree that ConnectionShutdown should be the event you should subscribe to when you want to know about connection shutdowns?</div>
<div><br></div><div>As far as the blocking, I&#39;m perplexed as to why we wouldn&#39;t be seeing the same results. �Obviously, having someone on your team be able to reproduce the issue is key to getting it fixed. �To make sure we&#39;re actually using the same bits, I&#39;ve uploaded the project I&#39;m testing with to�<a href="http://aspiringcraftsman.com/downloads/rabbitmq/">http://aspiringcraftsman.com/downloads/rabbitmq/</a>. �If you wouldn&#39;t mind, please try with this and see if you get the same results. �I&#39;m assuming you don&#39;t have the API installed into your GAC.</div>
<div><br></div><div><br></div><div>Derek</div><br><div class="gmail_quote">On Tue, Aug 21, 2012 at 9:38 AM, Emile Joubert <span dir="ltr">&lt;<a href="mailto:emile@rabbitmq.com" target="_blank">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 Derek,<br>
<div class="im"><br>
On 21/08/12 15:10, Derek Greer wrote:<br>
&gt; My apologizes, I should have included the version number. �I see this<br>
&gt; behavior using version 2.8.4 from NuGet. �Perhaps you&#39;re testing with a<br>
&gt; different version?<br>
<br>
</div>I tested with the latest version, but there have been no changes in that<br>
area since 2.8.4.<br>
<div class="im"><br>
&gt; That aside, there should never be a case when a client of the<br>
&gt; .Net rabbitmq client should be able to call .Close() and cause the API<br>
&gt; to block indefinitely.<br>
<br>
</div>I&#39;m not able to reproduce the deadlock, as I said, I see an exception<br>
(see attached).<br>
<div class="im"><br>
&gt; I appreciate your pointing me to the use of the IModel.ModelShutdown. �I<br>
&gt; would have thought that event would be raised any time the model was<br>
&gt; closed rather than being raised exclusively due to a connection<br>
&gt; shutdown. �I&#39;ll use that if I have to, but wouldn&#39;t you agree that<br>
&gt; clients of the API should be able to subscribe to the<br>
&gt; IConnection.ConnectionShutdown event to be alerted to connection<br>
&gt; shutdowns?<br>
<br>
</div>Yes, ModelShutdown is raised when the channel shuts down for any reason,<br>
including due to a network interruption. Clients that need notification<br>
of the network connection shutting down should subscribe to<br>
ConnectionShutdown, as your example illustrates. The library also<br>
includes an example (RabbitMQ.Client.Examples.ExceptionTest) that shows<br>
how to go about this.<br>
<br>
What is the problem you are trying to solve that the alleged deadlock is<br>
preventing you from solving? If the problem is to ensure that channels<br>
are closed when connections shut down, then you don&#39;t need to do that,<br>
since the library already takes care of it.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Emile<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><font face="georgia, serif" color="#c0c0c0">___________________________________________</font></div><font color="#333300" face="verdana, sans-serif"><span style="color:rgb(0,0,0)"><span style="color:rgb(51,51,0)">Derek Greer</span></span></font><div>
<a href="mailto:dbgreer@gmail.com" style="font-family:&#39;times new roman&#39;,serif" target="_blank">dbgreer@gmail.com</a><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif">� � �|�</span><a href="http://twitter.com/derekgreer" style="font-family:&#39;times new roman&#39;,serif" target="_blank">@derekgreer</a>
</div><div><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif"><a href="http://derekgreer.lostechies.com/" target="_blank">lostechies.com</a></span><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif">�</span><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif">|</span><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif">�</span><font color="#3333ff"><font face="&#39;times new roman&#39;, serif"><a href="http://derekgreer.freshbrewedcode.com" target="_blank">freshbrewedcode.com</a>�</font><span style="font-family:&#39;times new roman&#39;,serif">| <a href="http://aspiringcraftsman.com" target="_blank">aspiringcraftsman.com</a></span></font></div>
<div><div><div><span style="color:rgb(192,192,192);font-family:georgia,serif">___________________________________________</span><font color="#333300" face="georgia, serif"><br></font><div><div><div><font color="#666666" face="&#39;times new roman&#39;, serif"><br>
</font></div></div></div></div></div></div><br>