Git Product home page Git Product logo

dramatiq_sqs's Introduction

dramatiq_sqs

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 256KiB large and
  • messages must be processed within 2 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. Please see LICENSE for licensing details.

dramatiq_sqs's People

Contributors

bogdanp avatar dvazar avatar dalanar avatar gregbeech avatar pabloxio avatar pjsier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.