Skip to main content

An Amazon SQS broker for Dramatiq.

Project description

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 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.

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

dramatiq_sqs-0.4.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dramatiq_sqs-0.4.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file dramatiq_sqs-0.4.2.tar.gz.

File metadata

  • Download URL: dramatiq_sqs-0.4.2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","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}

File hashes

Hashes for dramatiq_sqs-0.4.2.tar.gz
Algorithm Hash digest
SHA256 db8ae6c4a54b35005213dd3369bb6c8e71ffc3033b6a9a8809d32e06a5cf3d59
MD5 b136e8585c48a962108cb2ed48027e5b
BLAKE2b-256 82b79632552cb4941b95927c92477e4d7c92f8937a1d40cb63f2e3b68a797873

See more details on using hashes here.

File details

Details for the file dramatiq_sqs-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: dramatiq_sqs-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","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}

File hashes

Hashes for dramatiq_sqs-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fcc3d38dddd1ebe1cef440de3f8aef91a85428529c931665f2c9e5c6d9e67b93
MD5 bbc5221a9ce7f1a1b0584df314f8082b
BLAKE2b-256 330a5ca53b7afdc36004342a99fb2a17c361f4a16d9662e8c72ad7f2cc7fff36

See more details on using hashes here.

Supported by

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