I just realized I sent this response directly to Emile instead of back to the list, so copying the list now.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Derek Greer</b> <span dir="ltr"><<a href="mailto:dbgreer@gmail.com">dbgreer@gmail.com</a>></span><br>
Date: Tue, Aug 21, 2012 at 11:21 AM<br>Subject: Re: [rabbitmq-discuss] .Net RabbitMQ.Client Issue: Deadlock on ConnectionShutdown<br>To: Emile Joubert <<a href="mailto:emile@rabbitmq.com">emile@rabbitmq.com</a>><br>
<br><br><div>Thanks for the example. I'll take a look at how its being done there.</div><div><br></div><div>Concerning subscriptions, I'm referring to a logical subscription not any particular component of the rabbitmq API. I have a Subscription class that represents a logical subscription which contains a Renew(IConnection connection) method which stops the current thread and restarts it with the newly available connection. I'm wanting to loop through all my Subscription instances and call Renew() after I have a new connection. Part of the Renew() logic is to stop the current thread, and part of the normal course of stopping is to attempt to close the channel/model.<div>
<div class="h5"><br>
<br><div class="gmail_quote">On Tue, Aug 21, 2012 at 11:13 AM, Emile Joubert <span dir="ltr"><<a href="mailto:emile@rabbitmq.com" target="_blank">emile@rabbitmq.com</a>></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><br>
On 21/08/12 16:38, Derek Greer wrote:<br>
> I'm trying to deal with connection shutdown logic as an atomic<br>
> operation. Here's the scenario I'm trying to implement:<br>
<br>
</div>I hesitate to mention it, because this library has been deprecated but<br>
not yet completely removed:<br>
<a href="http://hg.rabbitmq.com/rabbitmq-dotnet-messagepatterns/" target="_blank">http://hg.rabbitmq.com/rabbitmq-dotnet-messagepatterns/</a><br>
<br>
In it you will find an example of how one might go about reconnecting to<br>
a broker. Be warned that this code will be removed soon and is not<br>
guaranteed to work with recent versions of the broker.<br>
<br>
> o refresh each subscription with the new connection<br>
<br>
It is not possible to maintain the previous subscription to the broker<br>
and somehow inject a new channel and/or connection into it. You will<br>
need to re-establish all contained channels and all associated<br>
subscriptions when the connection shuts down.<br>
<div><br>
> aside, don't you agree that ConnectionShutdown should be the event you<br>
> should subscribe to when you want to know about connection shutdowns?<br>
<br>
</div>Yes.<br>
<div><br>
> As far as the blocking, I'm perplexed as to why we wouldn't be seeing<br>
> the same results.<br>
<br>
</div>When I run your Consumer.exe standalone I also get the same exception<br>
as before.<br>
<span><font color="#888888"><br>
<br>
<br>
-Emile<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><div class="im">-- <br><div><font face="georgia, serif" color="#c0c0c0">___________________________________________</font></div><font color="#333300" face="verdana, sans-serif"><span style><span style="color:rgb(51,51,0)">Derek Greer</span></span></font><div>
<a href="mailto:dbgreer@gmail.com" style="font-family:'times new roman',serif" target="_blank">dbgreer@gmail.com</a><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> | </span><a href="http://twitter.com/derekgreer" style="font-family:'times new roman',serif" target="_blank">@derekgreer</a>
</div><div><span style="color:rgb(51,51,255);font-family:'times new roman',serif"><a href="http://derekgreer.lostechies.com/" target="_blank">lostechies.com</a></span><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> </span><span style="color:rgb(51,51,255);font-family:'times new roman',serif">|</span><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> </span><font color="#3333ff"><font face="'times new roman', serif"><a href="http://derekgreer.freshbrewedcode.com" target="_blank">freshbrewedcode.com</a> </font><span style="font-family:'times new roman',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="'times new roman', serif"><br>
</font></div></div></div></div></div></div><br>
</div></div>
</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:'times new roman',serif" target="_blank">dbgreer@gmail.com</a><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> | </span><a href="http://twitter.com/derekgreer" style="font-family:'times new roman',serif" target="_blank">@derekgreer</a>
</div><div><span style="color:rgb(51,51,255);font-family:'times new roman',serif"><a href="http://derekgreer.lostechies.com/" target="_blank">lostechies.com</a></span><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> </span><span style="color:rgb(51,51,255);font-family:'times new roman',serif">|</span><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> </span><font color="#3333ff"><font face="'times new roman', serif"><a href="http://derekgreer.freshbrewedcode.com" target="_blank">freshbrewedcode.com</a> </font><span style="font-family:'times new roman',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="'times new roman', serif"><br>
</font></div></div></div></div></div></div><br>