<div dir="ltr"><span style="font-family: arial, sans-serif;">The main application exits because it has completed executing. Do you</span><br style="font-family: arial, sans-serif;"><span style="font-family: arial, sans-serif;">consider that a problem? (BTW I note that RestartConsumer() is not</span><br style="font-family: arial, sans-serif;"><span style="font-family: arial, sans-serif;">guaranteed to call Consume().)</span><div>- no, i am telling main application works still we have some data in queue, when queue is exhausted, still main application gets stuck in while loop (this is my expected behaviour, again when we have data in queue, it processes, this is the case for 90% of time). But out of that 10% time, i don't know what is the exact exception, so i have written restartconsumer to restart service, which is not working even, you have confirmed this.<br style="font-family: arial, sans-serif;"><br style="font-family: arial, sans-serif;"><span style="font-family: arial, sans-serif;">Do you expect an exception that never arrives, or do you get an</span><br style="font-family: arial, sans-serif;"><span style="font-family: arial, sans-serif;">exception that you don't expect, or do you get a different exception</span><br style="font-family: arial, sans-serif;"><span style="font-family: arial, sans-serif;">from the one you expect?</span></div><div><br></div><div>yes, i am getting an exception that i don't event expect.<br style="font-family: arial, sans-serif;"><br style="font-family: arial, sans-serif;"><span style="font-family: arial, sans-serif;">If the exception is unexpected could you please post the stacktrace?</span><br style="font-family: arial, sans-serif;"><br style="font-family: arial, sans-serif;"><span style="font-family: arial, sans-serif;">If the exception is missing or wrong in your view can you point out</span><br style="font-family: arial, sans-serif;"><span style="font-family: arial, sans-serif;">where you expect it to be thrown?</span></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">For this above question, i have to design separate consumer service and post you stacktrace and all required log files (give me 2 days time, i will do that), Sorry about that, i can not post my production rabbitmq server stacktrace, and consumers.<br></font><div><font face="arial, sans-serif"><br></font><br>On Friday, 30 August 2013 16:49:15 UTC+5:30, Arindam Nayak  wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">I have uploaded sample code for this. Link is -&nbsp;<a href="http://j.mp/rbconsumer" target="_blank">http://j.mp/rbconsumer</a>. &nbsp;<div><br></div><div>How to reproduce this --</div><div><br></div><div>Run the program , put break points on &nbsp;(Consumer.cs)</div><div>1. RestartConsumer() function start point,</div><div>2. while (isConsuming) {<div>3.&nbsp;catch (Exception exp)</div><div><br></div><div>I have not written producer for this, when i run this, i put something in queue(i.e. producer kind) from management UI.</div><div><br></div><div>So , when running the program it will 1st hit (#2 while (isConsuming)), and then introduce an exception (may be restart rabbitmq server or something else),</div><div>then it will hit "#3catch(Exception exp)", this will subsequently call restart code, you can check how, main application exits while executing restart code.</div><div><br></div><br>On Thursday, 29 August 2013 17:28:35 UTC+5:30, Arindam Nayak  wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have uploaded screencast for this - link &nbsp;- <a href="http://screencast.com/t/NG75rMlwOlH1" target="_blank">http://screencast.com/t/<wbr>NG75rMlwOlH1</a><br><br>On Thursday, 29 August 2013 12:48:20 UTC+5:30, Наиль Салихов  wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Did you get any exception when trying recreate connection?<br></div><div>Where you lost connection - in consumer or producer? Can you provide your code?&nbsp;</div><div>Without more detail information nobody can helps you.<br></div><div><br>среда, 28 августа 2013&nbsp;г., 15:15:11 UTC+4 пользователь Arindam Nayak написал:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have written a rabbitmq consumer service, which is a windows service, it constantly polls (something like while(true)) and reads queue data and process, it works fine for 4-5 days, but suddenly after that it gets detached from queue and stalls windows service until i manually restarts that windows service. I have using .net client libraries. I have also added restart code. that re creates connection , binds to queue and then listens , but that restart code does not work. When i tried to debug the service, it does not help, it stops debug process abruptly , at connection re-creation time. Please help.</div></blockquote></div></div></blockquote></div></blockquote></div></div></blockquote></div></div></div>