Using IronMQ

Installation

For IronMQ support, you’ll need the [iron_celery](http://github.com/iron-io/iron_celery) library:

  1. $ pip install iron_celery

As well as an [Iron.io account](http://www.iron.io). Sign up for free at [iron.io](http://www.iron.io).

Configuration

First, you’ll need to import the iron_celery library right after you import Celery, for example:

  1. from celery import Celery
  2. import iron_celery
  3. app = Celery('mytasks', broker='ironmq://', backend='ironcache://')

You have to specify IronMQ in the broker URL:

  1. BROKER_URL = 'ironmq://ABCDEFGHIJKLMNOPQRST:ZYXK7NiynGlTogH8Nj+P9nlE73sq3@'

where the URL format is:

  1. ironmq://project_id:token@

you must remember to include the “@” at the end.

The login credentials can also be set using the environment variables IRON_TOKEN and IRON_PROJECT_ID, which are set automatically if you use the IronMQ Heroku add-on. And in this case the broker url may only be:

  1. ironmq://

Clouds

The default cloud/region is AWS us-east-1. You can choose the IronMQ Rackspace (ORD) cloud by changing the URL to:

  1. ironmq://project_id:token@mq-rackspace-ord.iron.io

Results

You can store results in IronCache with the same Iron.io credentials, just set the results URL with the same syntax as the broker URL, but changing the start to ironcache:

  1. ironcache:://project_id:token@

This will default to a cache named “Celery”, if you want to change that:

  1. ironcache:://project_id:token@/awesomecache

More Information

You can find more information in the [iron_celery README](http://github.com/iron-io/iron_celery).