[rabbitmq-discuss] Autorecovery Issue

Ranjitha Shet ranjithavshet09 at gmail.com
Fri Jun 20 12:28:45 BST 2014


Hi,

 * Use a "regular" consumer (recommended)
 * Add a recovery listener and re-create the queueing consumer


I din get what u meant by "regular" consumer.. Should use DefaultConsumer?




On Fri, Jun 20, 2014 at 11:53 AM, Michael Klishin <mklishin at gopivotal.com>
wrote:

>
>
> On 20 June 2014 at 10:16:14, Ranjitha Shet (ranjithavshet09 at gmail.com)
> wrote:
> > > to receive message what I do is -->
> >
> > while(true){
> >
> > try{
> >
> > QueueingConsumer.Delivery delivery = consumer.nextDelivery();
> > ..
> > ..
> > }
> > catch (ShutdownSignalException sse) {
> >
> > // notify client about network disconnection
> > // check if connection and channel is open... if its open then
> > this current thread is delayed for some time so that exchange,
> > queue, binding and consumer are restored..
> >
> > } catch (java.io.IOException ioe) {
> >
> > }
> >
> >
> > } // end of while
>
> QueueingConsumers currently cannot be recovered: on shutdown,
> they modify their internal state in a way that marks them as "done".
> Think of them as Iterators which have a logical end.
>
> You have two options:
>
>  * Use a "regular" consumer (recommended)
>  * Add a recovery listener and re-create the queueing consumer
>
> Automatic connection recovery simply re-adds the consumer(s) you previously
> had, without knowing anything about their implementation and if they can
> "self terminate"
> like the QueueingConsumer does.
> --
> MK
>
> Software Engineer, Pivotal/RabbitMQ
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140620/58159b6c/attachment.html>


More information about the rabbitmq-discuss mailing list