otherqueues.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ==========================================================
  2. Using Celery with Redis/Database as the messaging queue.
  3. ==========================================================
  4. There's a plugin for celery that enables the use of Redis or an SQL database
  5. as the messaging queue. This is not part of celery itself, but exists as
  6. an extension to `carrot`_.
  7. .. _`carrot`: http://ask.github.com/carrot
  8. .. _`ghettoq`: http://ask.github.com/ghettoq
  9. Installation
  10. ============
  11. You need to install the latest development versions of `carrot`_ and
  12. `ghettoq`_.
  13. $ git clone git://github.com/ask/carrot.git
  14. $ cd carrot
  15. $ python setup.py install
  16. $ git clone git://github.com/ask/ghettoq.git
  17. $ cd ghettoq
  18. $ python setup.py install
  19. Redis
  20. =====
  21. Configuration
  22. -------------
  23. ::
  24. CARROT_BACKEND = "ghettoq.toproot.Redis"
  25. AMQP_HOST = "localhost" # Maps to redis host.
  26. AMQP_PORT = 6379 # Maps to redis port.
  27. AMQP_VHOST = "celery" # Maps to database name.
  28. Database
  29. ========
  30. Configuration
  31. -------------
  32. The database backend uses the Django ``DATABASE_*`` settings for database
  33. configuration values.
  34. * Set your carrot backend::
  35. CARROT_BACKEND = "ghettoq.toproot.Database"
  36. * Add ``ghettoq`` to ``INSTALLED_APPS``::
  37. INSTALLED_APPS = ("ghettoq", )
  38. * Sync your database schema.
  39. $ python manage.py syncdb
  40. * Or if you're not using django, but the default loader instad run
  41. ``celeryinit``::
  42. $ celeryinit
  43. Important notes
  44. ---------------
  45. These message queues does not have the concept of exchanges and routing keys,
  46. there's only the queue entity. As a result of this you need to set the name of
  47. the exchange to be the same as the queue::
  48. CELERY_AMQP_CONSUMER_QUEUE = "tasks"
  49. CELERY_AMQP_EXCHANGE = "tasks"