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
Close
Hashes for rabbitqueues-beeflow-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b694224a32c8ea02a65931f8119dc1730096ec30bac9fe05df052c32a30a3780 |
|
MD5 | c4d1f45b3a2ed588c183114001113f24 |
|
BLAKE2b-256 | e1bba51641ea3c870ac0067a12ee81e70a455d8e4f8c4e87e35dc0c9f764bdf5 |
Close
Hashes for rabbitqueues_beeflow-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4b1c793c06a948c5335939ce9b248e8892082236058ff89afc11cfb82e1e891 |
|
MD5 | 3be034676267de8927d568cdd85016e0 |
|
BLAKE2b-256 | 5a7da79c9c7202d2a0595b1c72b082cb95eb26f00337b88f85985bfc66424835 |