https://github.com/codesyntax/djamqpconsumer
Custom django command for consuming an amqp queue
https://github.com/codesyntax/djamqpconsumer
Last synced: 2 months ago
JSON representation
Custom django command for consuming an amqp queue
- Host: GitHub
- URL: https://github.com/codesyntax/djamqpconsumer
- Owner: codesyntax
- Created: 2014-02-13T08:54:55.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2022-06-14T11:52:45.000Z (about 4 years ago)
- Last Synced: 2025-11-22T01:04:01.439Z (7 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.txt
Awesome Lists containing this project
README
What is this
============
Adds a custom command which opens a blocking connection with an AMQP server and passes messages to a callback fuction
Settings
--------
This settings are requiered for the command run
``COM_BROKER``
AMQP server ip
``COM_VHOST``
AMQP server Virtual Host
``COM_USERNAME``
AMQP server User name for the virtual host
``COM_PASSWORD``
Username's password
``COM_QUEUE``
Which queue listen to
``CONSUMER_CALLBACK``
Path to the callback func. ex.: djamqpconsumer.printconsumer.printdata
Function's return value must be a dict with this format::
{'result': 0/1,
'msg': 'String for debug purpouse',
'retry': True/Fals #Task will be requeued if this is True and task.expiration > 0
}
``DJCONSUMER_TTL``
TTL for de delayed queue in miliseconds (default 20000).
Task will be requeued to a delayed queue if its expiration time is not over and the callback function set the
retry flag
Install
-------
Use pip to install from PyPI::
pip install djamqpconsumer
Usage
-----
Add ``djamqpconsumer`` to your settings.py file::
INSTALLED_APPS = (
...
'djamqpconsumer',
...
)
Use with manage.py::
manage.py consumer [debug]