<div dir="ltr">Hi,<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"> * Use a "regular" consumer (recommended)</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px"> * Add a recovery listener and re-create the queueing consumer</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">I din get what u meant by "regular" consumer.. Should use </span><font face="arial, sans-serif">DefaultConsumer?</font></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 20, 2014 at 11:53 AM, Michael Klishin <span dir="ltr"><<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><br>
<br>
On 20 June 2014 at 10:16:14, Ranjitha Shet (<a href="mailto:ranjithavshet09@gmail.com">ranjithavshet09@gmail.com</a>) wrote:<br>
> > to receive message what I do is --><br>
><br>
> while(true){<br>
><br>
> try{<br>
><br>
> QueueingConsumer.Delivery delivery = consumer.nextDelivery();<br>
> ..<br>
> ..<br>
> }<br>
> catch (ShutdownSignalException sse) {<br>
><br>
> // notify client about network disconnection<br>
> // check if connection and channel is open... if its open then<br>
> this current thread is delayed for some time so that exchange,<br>
> queue, binding and consumer are restored..<br>
><br>
> } catch (java.io.IOException ioe) {<br>
><br>
> }<br>
><br>
><br>
> } // end of while<br>
<br>
</div>QueueingConsumers currently cannot be recovered: on shutdown,<br>
they modify their internal state in a way that marks them as "done".<br>
Think of them as Iterators which have a logical end.<br>
<br>
You have two options:<br>
<br>
* Use a "regular" consumer (recommended)<br>
* Add a recovery listener and re-create the queueing consumer<br>
<br>
Automatic connection recovery simply re-adds the consumer(s) you previously<br>
had, without knowing anything about their implementation and if they can "self terminate"<br>
like the QueueingConsumer does. <br>
<div class=""><div class="h5">--<br>
MK<br>
<br>
Software Engineer, Pivotal/RabbitMQ<br>
</div></div></blockquote></div><br></div></div>