Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Herbie Adapter for messaging publishing to AWS SNS/SQS

Project description

AWS SNS/SQS Adapter

This Adapter is based on Django and provides a way to publish messages to AWS SNS/SQS.

The default configuration creates a single SNS Topic on which a single SQS Queue subscribes for new messages.

An example SQS consumer is also available.

It is meant to be used with Herbie.

Installation

The package already provides a Django app that just needs to be registered in the main Django app using Herbie.

  1. Run the following
    pip install herbie-aws-sns-sqs-adapter

or add it to your app requirements.txt and update them running:

pip install -r requirements.txt
  1. Add the adapter App to Django Installed Apllications:
INSTALLED_APPS = [
    ...
    'aws_sns_sqs_adapter.apps.HerbieAwsSnsSqsAdapterConfig',
    ...
]
  1. Configure the AWS environment variables:
AWS_ACCESS_KEY_ID="access_key",
AWS_SECRET_ACCESS_KEY="secret_key",
AWS_SQS_SNS_ENDPOINT_URL="sns_sqs_endpoint",
AWS_SQS_SNS_REGION="sns_sqs_region",
  1. Run command to create the SNS/SQS Topics/Queues according to the schemas available. This command will create 1 SNS Topic and 1 SQS Queue per schema available; the queue will subscribe to the respective created topic.
python manage.py init_sns_sqs

An example Django application using this adapter can be found at the Herbie Sandbox repository.

Developing/Testing

If you would like to further improve this package you'll need to install the dev/test requirmeents.

To to this run in your virtual environment

    pip install -e .[tests]

This will install the needed packages (e.g: pytest) to run/test locally the package

Black Formatter

This package uses Black as a code formatter. You should run it before pushing the code as the CI pipeline checks against it.

    black --line-length 119 .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for herbie-aws-sns-sqs-adapter, version 1.0b1
Filename, size File type Python version Upload date Hashes
Filename, size herbie_aws_sns_sqs_adapter-1.0b1-py3-none-any.whl (8.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size herbie-aws-sns-sqs-adapter-1.0b1.tar.gz (8.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page