Skip to main content

dramatiq_sqs

[!WARNING]
The project is under active development. There will be breaking changes before v1.0.0. Please make sure to pin the version when using this for anything important.

A Dramatiq broker that can be used with Amazon SQS.

This backend has a number of limitations compared to the built-in Redis and RMQ backends:

  • the max amount of time messages can be delayed by is 15 minutes,
  • messages can be at most 1MiB large by default (configurable via max_message_size) and
  • messages must be processed within 12 hours of being pulled, otherwise they will be redelivered.

The backend uses boto3 under the hood. For details on how authorization works, check out its docs.

Installation

pip install dramatiq_sqs

Usage

import dramatiq

from dramatiq.middleware import AgeLimit, TimeLimit, Callbacks, Pipelines, Prometheus, Retries
from dramatiq_sqs import SQSBroker

broker = SQSBroker(
    namespace="dramatiq_sqs_tests",
    middleware=[
        Prometheus(),
        AgeLimit(),
        TimeLimit(),
        Callbacks(),
        Pipelines(),
        Retries(min_backoff=1000, max_backoff=900000, max_retries=96),
    ],
)
dramatiq.set_broker(broker)

Usage with ElasticMQ

broker = SQSBroker(
    # ...
    endpoint_url="http://127.0.0.1:9324",
)

Example IAM Policy

Here are the IAM permissions needed by Dramatiq:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "sqs:CreateQueue",
                "sqs:ReceiveMessage",
                "sqs:DeleteMessage",
                "sqs:DeleteMessageBatch",
                "sqs:SendMessage",
                "sqs:SendMessageBatch"
            ],
            "Resource": ["*"]
        }
    ]
}

License

dramatiq_sqs is licensed under Apache 2.0.

Release files for dramatiq-sqs 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dramatiq-sqs 0.4.4
File Size Uploaded
dramatiq_sqs-0.4.4.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dramatiq-sqs 0.4.4
File Interpreter ABI Platform
dramatiq_sqs-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / dramatiq_sqs-0.4.4.tar.gz

Download URL dramatiq_sqs-0.4.4.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
518f3abb8a081b610d96c76eb1c571d9dca4724a776114e2bb11b5f0e89795af
BLAKE2b-256 checksum
How to use checksums
b23a7f7b0fa92c23c3e7a0928a9b74d853143fd2fd9d5357cb66528eeb8ecb91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / dramatiq_sqs-0.4.4-py3-none-any.whl

Download URL dramatiq_sqs-0.4.4-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c9b9f03e0850bc1702f349c8ba68477087e024a167231f1ae148dac7ce1ed3b
BLAKE2b-256 checksum
How to use checksums
ea787733536d98e6ed1b6b0c0b6debd3cc6fdb91ea813dad101d097713a236ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page