Azure Queue Brokers for Dramatiq
Project description
dramatiq-azure
A Dramatiq broker that can be used with Microsoft Azure queue services.
Heavily inspired by Dramatiq SQS, this package currently implements a broker for Azure Storage Queue. An implementation for Azure Service Bus is planned... eventually.
Installation
pip install dramatiq-azure
Usage
ASQBroker
The broker looks for AZURE_STORAGE_CONNECTION_STR
in the environment, to authenticate on Azure Storage.
You need to make sure that the variable exists at runtime.
Creating a connection string for your Azure account is documented here.
import os
import dramatiq
from dramatiq.middleware import AgeLimit, TimeLimit, Callbacks, Pipelines, Prometheus, Retries
from dramatiq_azure import ASQBroker
broker = ASQBroker(
dead_letter=True,
middleware=[
Prometheus(),
AgeLimit(),
TimeLimit(),
Callbacks(),
Pipelines(),
Retries(min_backoff=1000, max_backoff=900000, max_retries=96),
],
)
dramatiq.set_broker(broker)
Tests
Tests require a running Azurite instance. You can easily launch azurite
through Docker.
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite
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
dramatiq_azure-0.1.3.tar.gz
(8.4 kB
view hashes)
Built Distribution
Close
Hashes for dramatiq_azure-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a30fa760ea20fdfe4cb5d8d278223d8fc8876c649e04df1f0daa80a7def3c315 |
|
MD5 | 20a7b9b680fd73d0ce7891ab1d40ec9b |
|
BLAKE2b-256 | 8722fd61047f908197ba08a2a6f89c91109135fa6c014ba0591ee983ea54d3c3 |