[rabbitmq-discuss] rabbitmq consumer - Writing code that survive failures

Michael Klishin mklishin at gopivotal.com
Sun Mar 23 12:22:08 GMT 2014


On 23 March 2014 at 16:08:14, rails (stammailbox at gmail.com) wrote:
> > When exception occurs, will I need to check if connection is  
> still open and close it?

What kind of exception? After a network failure your consumer will get
a shutdown notification [1].

Consumers need to be recovered after connection & channel recovery.

> What if other consumer who uses it is alive and receiving? wouldn't  
> it kill it too?

An uncaught exception in one consumer does not affect other consumers
as long as it does not cause their channel to be closed.

> Is it recomendded to open multiple connections?

As far as recovery goes, the process is the same, so there is no benefit.

RabbitMQ Java client master (future 3.3.0 release) supports automatic
recovery with one limitation: messages published during connection
outage are not enqueued internally and thus won’t be redelivered later.

Also, see Lyra [2].

1. http://www.rabbitmq.com/api-guide.html#shutdown
2. https://github.com/jhalterman/lyra 
--  
MK  

Software Engineer, Pivotal/RabbitMQ


More information about the rabbitmq-discuss mailing list