Skip to main content

SNS + SQS Communications made easy

Project description


Build Status

✉️ Async communications using AWS SNS + SQS for Python services ✨


In-Memory event manager

Show me the code

from razemax.event_manager import EventManager

class NorthKoreaThreatCreatedEvent:
    def __init__(self, id, target): = id = target

def trump_subscriber(event: NorthKoreaThreatCreatedEvent):
    print(f"North korea will attack us or {}!")
EventManager.subscribe(trump_subscriber, NorthKoreaThreatCreatedEvent)
EventManager.trigger(NorthKoreaThreatCreatedEvent(0, "Mexico"))


North korea will attack us or Mexico!

Trigger subscribers from SQS


SQS queue has to be subscribed to SNS topic before running the consumer


from razemax.consumers import MessageConsumer
from razemax.drivers import SQSDriver
from razemax.event_manager import EventManager
from razemax.publisher import SNSMessagePublisher

def kp_message_to_event(message):
    # Highly recommended to use Marshmallow to validate
    return NorthKoreaThreatCreatedEvent(message.body['id'], message.body['target_name'])

mapper = {
    'KPThreatCreated': kp_message_to_event

aws_settings = {
    'region_name': "",
    'aws_access_key_id': "",
    'aws_secret_access_key': "",
    'endpoint_url': ""

queue_driver ="korea-threats-queue", aws_settings)
MessageConsumer(mapper, EventManager, queue_driver).process_message()

publisher =, 'korea-topic')
publisher.publish('KPThreatCreated', {'id': 21, 'target_name': 'Portugal'})


North korea will attack us or Portugal!

Installing (TODO)

pip install

Running the tests

To run end to end tests do:

make unit-tests
make integration-tests



This project is licensed under the MIT License - see the file for details

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

razemax-0.0.8.tar.gz (4.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page