/simple-message-handler

A simple message handler to practice some skills

Primary LanguagePython

Simple Message Handler

It is what it is! A simple message handler using Loafer package to practice some skills 😄


🔨 Requirements

  • Python
  • Poetry
  • Docker/Docker Compose

🔍 Context

In order to represent a problem to solve, there was a context that was thought and it uses SNS/SQS topics and queues, external API calls, error handling and monitoring.

Diagram

flow

Assets

  • SNS topics: order_canceled, package_canceled using Localstack;
  • SQS queues: canceled_orders using Localstack;
  • API: mocked API using Mockoon to do some sample external HTTP calls.

Structure

structure

Install and run locally

To list all Makefile commands:

make list-commands

Install the project

poetry install && poetry shell

Start Localstack and Mockoon:

make dep-start

Publish sample message:

make publish-sample

Run handler:

make run

📊 Testing

To run pytest tests:

make test

All tests

tests

Code coverage

coverage


Made for studies 📚 purposes by RafaelEmery