Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rabbitqueues-beeflow-0.0.7.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

rabbitqueues_beeflow-0.0.7-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

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

Hashes for rabbitqueues-beeflow-0.0.7.tar.gz
Algorithm Hash digest
SHA256 b694224a32c8ea02a65931f8119dc1730096ec30bac9fe05df052c32a30a3780
MD5 c4d1f45b3a2ed588c183114001113f24
BLAKE2b-256 e1bba51641ea3c870ac0067a12ee81e70a455d8e4f8c4e87e35dc0c9f764bdf5

See more details on using hashes here.

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

Hashes for rabbitqueues_beeflow-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e4b1c793c06a948c5335939ce9b248e8892082236058ff89afc11cfb82e1e891
MD5 3be034676267de8927d568cdd85016e0
BLAKE2b-256 5a7da79c9c7202d2a0595b1c72b082cb95eb26f00337b88f85985bfc66424835

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page