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
pip install dramatiq-azure[identity] # for passwordless authentication
Usage
ASQBroker
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)
Authentication
The following authentication methods are supported by the broker:
- Connection string based:
AZURE_STORAGE_CONNECTION_STR
environment variable must be set. If this variable is not set, passwordless authentication will be used. Creating a connection string for your Azure account is documented here. - Passwordless (token-based) authentication (Recommended):
AZURE_STORAGE_ACCOUNT_NAME
environment variable must be set.
The list of other mandatory variables depends on where the app is being run. More information can be found here.
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
Run the test suite
pytest
Contributions
Found an itch you know how to scratch? PR welcome
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.3.0.tar.gz
(9.2 kB
view hashes)
Built Distribution
Close
Hashes for dramatiq_azure-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1db5307183b4a70c719b4b7d81506037a034a70cd03ea2d7d76b955472f3688 |
|
MD5 | 4b289bd2bcc3e63ca1a28b8e6e4f330e |
|
BLAKE2b-256 | 731e5fb5702b93b6a237f7faa206dc0b97ec4758721ab976ac12c6f66c16006e |