Application to manage RabbitMQ queues
Project description
Rabbit queues
Application to manage RabbitMQ queues
Configuration
Into the setup.py
file add:
INSTALLED_APPS = [
...
"rabbitqueues",
]
and add (i.e.):
RABBITMQ_HOSTNAME = "localhost"
RABBITMQ_PORT = 5672
RABBITMQ_USERNAME = "rabbitusername"
RABBITMQ_PASSWORD = "supersecretpassword"
RABBITMQ_VHOST = "/"
Own consumers
To prepare own conumer you need to create class
which will extend AbstractManager
. and register it in
dictionary RABBITMQ_QUEUE_CONSUMERS = {"consumer_name": consumer_class}
in setup.py
.
Publish to the queue example
import json
from django.conf import settings
from rabbitqueues import RabbitQueue
queue = RabbitQueue(settings.RABBITMQ_EMAIL_QUEUE)
queue.basic_publish(
routing_key=settings.RABBITMQ_EMAIL_QUEUE,
body=json.dumps(
{
"subject": "some subject",
"email_from": settings.DEFAULT_FROM_EMAIL,
"recipient_list": ["test@test.com"],
"message": "This is the message for user.",
}
),
)
queue.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rabbitqueues-beeflow-0.0.7.tar.gz
.
File metadata
- Download URL: rabbitqueues-beeflow-0.0.7.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b694224a32c8ea02a65931f8119dc1730096ec30bac9fe05df052c32a30a3780 |
|
MD5 | c4d1f45b3a2ed588c183114001113f24 |
|
BLAKE2b-256 | e1bba51641ea3c870ac0067a12ee81e70a455d8e4f8c4e87e35dc0c9f764bdf5 |
File details
Details for the file rabbitqueues_beeflow-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: rabbitqueues_beeflow-0.0.7-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4b1c793c06a948c5335939ce9b248e8892082236058ff89afc11cfb82e1e891 |
|
MD5 | 3be034676267de8927d568cdd85016e0 |
|
BLAKE2b-256 | 5a7da79c9c7202d2a0595b1c72b082cb95eb26f00337b88f85985bfc66424835 |