The environment variable `RABBITMQ\_HOSTS` can also be used which will causeattempt to connect to a host in a random order. The list should be comma separated.

RABBITMQ_HOSTS=rabbitmq1.example.com,rabbitmq2.example.com

## Consumers

Consumers are a class with 2 required methods: `consume` and `shutdown`. AMQPDispatcher will not monkey patch the environment, you will have to do thatyourself.

### `consume`

`consume` is called once for each message being handled. It should take 2parameters, a proxy for AMQP operations (`amqp`) and the message (`msg`).

### `shutdown`

`shutdown` is called before the instance of the consumer is removed. It takes asingle argument `exception` which may be `None`. If your consumer raises anexception while consuming the `shutdown` method will be called. Once `shutdown`is finished a new instance of your consumer will be created to replace the onethat raised the exception. If you would like to rate limit instance replacementyou can call `gevent.sleep(X)` to sleep for `X` seconds after a failure.

`prefetch_count` is the AMQP `prefetch_count` when consuming. The`consumer_count` is the number of instances of your consumer to handle messagesfrom that queue. Connection pools are highly recommended.MySQL will require the [MySQLConnector]http://pypi.python.org/pypi/mysql-connector-python instead of`mysqldb` in order for gevent to switch properly.

Pools can be created and attached to the consumer class during the `__init__`. Example with SQLAlchemy