dstilesr / python-sns-publish-listen

A pair of fastAPI services to publish - subscribe to an SNS topic.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Pair of API to Publish / Listen to SNS

Contents

About

This project consists of a pair of fastAPI apis, one that publishes simple messages to an SNS topic and one that listens to the topic via HTTP. I did this to gain familiarity with the subject and perhaps to use the code as templates or guidance later on.

Run the Project

Run with docker-compose

To start both APIs you can use docker-compose:

docker-compose up

This will start both services. The publisher listens on port 8000 and the subscriber listens on 3000. The publisher will publish any messages posted to it to SNS. Both services have documentation URL /redoc.

Test locally with live SNS

In order to test locally with SNS, you must make the subscriber's port public. You can do this with ngrok:

ngrok http 3000

Remember to add the ngrok URL to the subscriber's .env file!

Built With

Back to top.

About

A pair of fastAPI services to publish - subscribe to an SNS topic.


Languages

Language:Python 91.2%Language:HCL 4.7%Language:Dockerfile 4.2%