Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paoliniluis/metabase-pub-sub-nginx
Nginx acting as a reverse proxy that mirrors traffic to an API that sends data to SQS for pub/sub
https://github.com/paoliniluis/metabase-pub-sub-nginx
Last synced: 7 days ago
JSON representation
Nginx acting as a reverse proxy that mirrors traffic to an API that sends data to SQS for pub/sub
- Host: GitHub
- URL: https://github.com/paoliniluis/metabase-pub-sub-nginx
- Owner: paoliniluis
- License: mit
- Created: 2022-05-13T02:35:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-11T18:45:12.000Z (about 1 year ago)
- Last Synced: 2024-11-07T06:47:33.304Z (about 2 months ago)
- Language: Python
- Size: 103 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# metabase-pub-sub-nginx
Nginx acting as a reverse proxy that mirrors traffic to an API that sends data to SQS for pub/sub## How to run this project?
1) Install Docker 20.10+
2) Create a topic in aws sns and a subscriber (like an https endpoint in requestbin to validate that the flow is working accordingly)
3) Complete the environment variables in docker-compose.yaml (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_TOPIC_ARN). You need an access key in AWS that can publish messages to a topic
4) Do docker compose up## How does this work?
Nginx provides a feature to mirror every single request it gets to other upstreams (check default.conf in nginx folder), so in this case is mirroring everything to a Node.JS endpoint that is listening to any verb and filters only the requests that are being done to /api/. From there, you can code any custom logic in the endpoint to either filter the relevant events you need or you can send everything without filtering to SNS from where you can integrate with any AWS service in a pub/sub type of architecture.
## Overal architecture
![Metabase-SNS](SNS-Metabase.png)
## Pending
More examples, the project was done in one afternoon as a PoC.