Skip to content

Commit

Permalink
Examples now use broker URL. sqlakombu is currently broken though, ne…
Browse files Browse the repository at this point in the history
…ed to find a solutionf or that
  • Loading branch information
ask committed Aug 20, 2011
1 parent bb0ec91 commit 6264757
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 33 deletions.
22 changes: 17 additions & 5 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ It should contain all you need to run a basic Celery set-up.
CELERY_RESULT_DBURI = "sqlite:///mydatabase.db"
## Broker settings.
BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_VHOST = "/"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_URL = "amqp://guest:guest@localhost:5672//"
## Worker settings
## If you're doing mostly I/O you can have more processes,
Expand Down Expand Up @@ -538,6 +534,22 @@ You can use a custom transport class name, or select one of the
built-in transports: ``amqplib``, ``pika``, ``redis``, ``beanstalk``,
``sqlalchemy``, ``django``, ``mongodb``, ``couchdb``.

.. setting:: BROKER_URL

Default broker URL. This must be an URL in the format of::

transport://userid:password@hostname:port/virtual_host

If this setting is defined it will override a subset of the
other ``BROKER`` options, these options are :setting:`BROKER_HOST`,
:setting:`BROKER_USER`, :setting:`BROKER_PASSWORD`, :setting:`BROKER_PORT`,
and :setting:`BROKER_VHOST`. The query part of the URL can also be used
to set options, e.g.::

amqp://localhost/myvhost?ssl=1

See the Kombu documentation for more information about broker URLs.

.. setting:: BROKER_HOST

BROKER_HOST
Expand Down
6 changes: 1 addition & 5 deletions docs/getting-started/first-steps-with-celery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ Let's create our :file:`celeryconfig.py`.

1. Configure how we communicate with the broker (RabbitMQ in this example)::

BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "myuser"
BROKER_PASSWORD = "mypassword"
BROKER_VHOST = "myvhost"
BROKER_URL = "amqp://guest:guest@localhost:5672//"

2. Define the backend used to store task metadata and return values::

Expand Down
13 changes: 7 additions & 6 deletions docs/tutorials/otherqueues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ Configuration
Configuration is easy, set the transport, and configure the location of
your Redis database::

BROKER_TRANSPORT = "redis"
BROKER_URL = "redis://localhost:6379/0"

BROKER_HOST = "localhost" # Maps to redis host.
BROKER_PORT = 6379 # Maps to redis port.
BROKER_VHOST = "0" # Maps to database number.

Where the URL is in the format of::

redis://userid:password@hostname:port/db_number


Results
Expand Down Expand Up @@ -68,7 +69,7 @@ an SQLAlchemy database URI.

#. Set your broker transport::

BROKER_TRANSPORT = "sqlakombu.transport.Transport"
BROKER_TRANSPORT = "sqlalchemy"

#. Configure the database URI::

Expand Down Expand Up @@ -127,7 +128,7 @@ configuration values.

#. Set your broker transport::

BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport"
BROKER_TRANSPORT = "django"

#. Add :mod:`djkombu` to `INSTALLED_APPS`::

Expand Down
2 changes: 1 addition & 1 deletion examples/app/myapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


celery = Celery("myapp")
celery.conf.update(BROKER_HOST="localhost")
celery.conf.update(BROKER_URL="amqp://guest:guest@localhost:5672//")


@celery.task
Expand Down
5 changes: 1 addition & 4 deletions examples/celery_http_gateway/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

CARROT_BACKEND = "amqp"
CELERY_RESULT_BACKEND = "database"
BROKER_HOST = "localhost"
BROKER_VHOST = "/"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_URL = "amqp://guest:guest@localhost:5672//"

ADMINS = (
# ('Your Name', '[email protected]'),
Expand Down
5 changes: 1 addition & 4 deletions examples/eventlet/celeryconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

CELERYD_POOL = "eventlet"

BROKER_HOST = "localhost"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "/"
BROKER_URL = "amqp://guest:guest@localhost:5672//"
CELERY_DISABLE_RATE_LIMITS = True
CELERY_RESULT_BACKEND = "amqp"
CELERY_TASK_RESULT_EXPIRES = 30 * 60
Expand Down
5 changes: 1 addition & 4 deletions examples/gevent/celeryconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

CELERYD_POOL = "gevent"

BROKER_HOST = "localhost"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "/"
BROKER_URL = "amqp://guest:guest@localhost:5672//"
CELERY_DISABLE_RATE_LIMITS = True
CELERY_RESULT_BACKEND = "amqp"
CELERY_TASK_RESULT_EXPIRES = 30 * 60
Expand Down
5 changes: 1 addition & 4 deletions examples/pythonproject/demoapp/celeryconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
import os
sys.path.insert(0, os.getcwd())

BROKER_HOST = "localhost"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "/"
BROKER_URL = "amqp://guest:guest@localhost:5672//"

CELERY_IMPORTS = ("tasks", )

Expand Down

0 comments on commit 6264757

Please sign in to comment.