Browse Source

Updated otherqueues tutorial to use Kombu transports

Ask Solem 14 years ago
parent
commit
7ac4c74d0a
1 changed files with 63 additions and 13 deletions
  1. 63 13
      docs/tutorials/otherqueues.rst

+ 63 - 13
docs/tutorials/otherqueues.rst

@@ -35,12 +35,66 @@ your Redis database::
     BROKER_PORT = 6379         # Maps to redis port.
     BROKER_VHOST = "0"         # Maps to database number.
 
-.. _otherqueues-database:
+.. _otherqueues-sqlalchemy:
 
-Database
-========
+Django Database
+===============
 
-.. _otherqueues-database-conf:
+.. _otherqueues-sqlalchemy-conf:
+
+For the SQLAlchemy database transport support you have to install the
+`kombu-sqlalchemy` library::
+
+    $ pip install -U kombu-sqlalchemy
+
+Configuration
+-------------
+
+This transport uses only the :setting:`BROKER_HOST` setting, which have to be
+an SQLAlchemy database URI.
+
+#. Set your broker transport::
+
+    BROKER_BACKEND = "sqlakombu.transport.Transport"
+
+#. Configure the database URI::
+
+    BROKER_HOST = "sqlite://celerydb.sqlite"
+
+Please see `SQLAlchemy: Supported Databases`_ for a table of supported databases.
+Some other `SQLAlchemy Connection String`_, examples:
+
+.. code-block:: python
+
+    # sqlite (filename)
+    BROKER_HOST = "sqlite:///celerydb.sqlite"
+
+    # mysql
+    BROKER_HOST = "mysql://scott:tiger@localhost/foo"
+
+    # postgresql
+    BROKER_HOST = "postgresql://scott:tiger@localhost/mydatabase"
+
+    # oracle
+    BROKER_HOST = "oracle://scott:tiger@127.0.0.1:1521/sidname"
+
+.. _`SQLAlchemy: Supported Databases`:
+    http://www.sqlalchemy.org/docs/dbengine.html#supported-databases
+
+.. _`SQLAlchemy Connection String`:
+    http://www.sqlalchemy.org/docs/dbengine.html#create-engine-url-arguments
+
+.. _otherqueues-django:
+
+Django Database
+===============
+
+.. _otherqueues-django-conf:
+
+For the Django database transport support you have to install the
+`django-kombu` library::
+
+    $ pip install -U django-kombu
 
 Configuration
 -------------
@@ -48,14 +102,13 @@ Configuration
 The database backend uses the Django `DATABASE_*` settings for database
 configuration values.
 
-#. Set your carrot backend::
+#. Set your broker transport::
 
-    CARROT_BACKEND = "ghettoq.taproot.Database"
+    BROKER_BACKEND = "djkombu.transport.DatabaseTransport"
 
+#. Add :mod:`djkombu` to `INSTALLED_APPS`::
 
-#. Add :mod:`ghettoq` to `INSTALLED_APPS`::
-
-    INSTALLED_APPS = ("ghettoq", )
+    INSTALLED_APPS = ("djkombu", )
 
 
 #. Verify you database settings::
@@ -69,9 +122,6 @@ configuration values.
   you should read the Django database settings reference:
   http://docs.djangoproject.com/en/1.1/ref/settings/#database-engine
 
-
 #. Sync your database schema.
 
-    When using Django::
-
-        $ python manage.py syncdb
+    $ python manage.py syncdb