mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
docs: mongodb broker
This commit is contained in:
@@ -20,7 +20,7 @@ Features
|
||||
- Django Admin integration
|
||||
- PaaS compatible with multiple instances
|
||||
- Multi cluster monitor
|
||||
- Redis, Disque, IronMQ, SQS or ORM
|
||||
- Redis, Disque, IronMQ, SQS, MongoDB or ORM
|
||||
- Python 2 and 3
|
||||
|
||||
Requirements
|
||||
@@ -39,6 +39,7 @@ Brokers
|
||||
- `Disque <https://django-q.readthedocs.org/en/latest/brokers.html#disque>`__
|
||||
- `IronMQ <https://django-q.readthedocs.org/en/latest/brokers.html#ironmq>`__
|
||||
- `Amazon SQS <https://django-q.readthedocs.org/en/latest/brokers.html#amazon-sqs>`__
|
||||
- `MongoDB <https://django-q.readthedocs.org/en/latest/brokers.html#mongodb>`__
|
||||
- `Django ORM <https://django-q.readthedocs.org/en/latest/brokers.html#django-orm>`__
|
||||
|
||||
Installation
|
||||
|
||||
@@ -76,10 +76,12 @@ Although `SQS <https://aws.amazon.com/sqs/>`__ is not the fastest, it is stable,
|
||||
|
||||
MongoDB
|
||||
-------
|
||||
The
|
||||
This highly scalable NoSQL database makes for a very fast and reliably persistent at-least-once message broker.
|
||||
Usually available on most PaaS providers, as `open-source <https://www.mongodb.org/>`__ or commercial `enterprise <https://www.mongodb.com/lp/download/mongodb-enterprise>`__ edition.
|
||||
|
||||
* Delivery receipts
|
||||
* Needs Django's `Cache framework <https://docs.djangoproject.com/en/1.8/topics/cache/#setting-up-the-cache>`__ configured for monitoring
|
||||
* Can be configured as the Django cache-backend through several open-source cache providers.
|
||||
* Requires the `pymongo <https://github.com/mongodb/mongo-python-driver>`__ driver: ``pip install pymongo``
|
||||
* See the :ref:`mongo_configuration` configuration section for options.
|
||||
|
||||
@@ -94,6 +96,7 @@ However for a medium message rate and scheduled tasks, this is the most convenie
|
||||
* Delivery receipts
|
||||
* Supports bulk dequeue
|
||||
* Needs Django's `Cache framework <https://docs.djangoproject.com/en/1.8/topics/cache/#setting-up-the-cache>`__ configured for monitoring
|
||||
* Can be `configured <https://docs.djangoproject.com/en/1.8/topics/cache/#database-caching>`__ as its own cache backend.
|
||||
* Queue editable in Django Admin
|
||||
* See the :ref:`orm_configuration` configuration on how to set it up.
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ Set ``orm`` to the name of that database connection and make sure you run migrat
|
||||
|
||||
mongo
|
||||
~~~~~
|
||||
To use MongoDB as a message broker you simply provide the connection information in a dictionary ::
|
||||
To use MongoDB as a message broker you simply provide the connection information in a dictionary::
|
||||
|
||||
# example MongoDB broker connection
|
||||
|
||||
@@ -284,7 +284,7 @@ To use MongoDB as a message broker you simply provide the connection information
|
||||
}
|
||||
}
|
||||
|
||||
The ``mongo`` dictionary can contain any of the parameters exposed by pymongo's`MongoClient<https://api.mongodb.org/python/current/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient>`__
|
||||
The ``mongo`` dictionary can contain any of the parameters exposed by pymongo's `MongoClient <https://api.mongodb.org/python/current/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient>`__
|
||||
|
||||
mongo_db
|
||||
~~~~~~~~
|
||||
|
||||
@@ -20,7 +20,7 @@ Features
|
||||
- Django Admin integration
|
||||
- PaaS compatible with multiple instances
|
||||
- Multi cluster monitor
|
||||
- Redis, Disque, IronMQ, SQS or ORM
|
||||
- Redis, Disque, IronMQ, SQS, MongoDB or ORM
|
||||
- Python 2 and 3
|
||||
|
||||
|
||||
|
||||
@@ -68,10 +68,15 @@ Optional
|
||||
|
||||
$ pip install iron-mq
|
||||
|
||||
- `Pymongo <https://github.com/mongodb/mongo-python-driver>`__ is needed if you want to use MongoDB as a message broker::
|
||||
|
||||
$ pip install pymongo
|
||||
|
||||
- `Redis <http://redis.io/>`__ server is the default broker for Django Q. It provides the best performance and does not require Django's cache framework for monitoring.
|
||||
|
||||
- `Disque <https://github.com/antirez/disque>`__ server is based on Redis by the same author, but focuses on reliable queues. Currently in Alpha, but highly recommended. You can either build it from source or use it on Heroku through the `Tynd <https://disque.tynd.co/>`__ beta.
|
||||
|
||||
- `MongoDB <https://www.mongodb.org/>`__ is a highly scalable NoSQL database which makes for a very fast and reliably persistent at-least-once message broker. Usually available on most PaaS providers.
|
||||
|
||||
Compatibility
|
||||
-------------
|
||||
|
||||
@@ -79,6 +79,10 @@ a single keyword dict named ``q_options``. This enables you to use these keyword
|
||||
|
||||
Please not that this will override any other option keywords.
|
||||
|
||||
.. note::
|
||||
For tasks to be processed you will need to have a worker cluster running in the background using ``python manage.py qcluster``
|
||||
or you need to configure Django Q to run in synchronous mode for testing using the :ref:`sync` option.
|
||||
|
||||
.. _groups:
|
||||
|
||||
Groups
|
||||
|
||||
Reference in New Issue
Block a user