Skip to content

yhobby/fastapi_task

Repository files navigation

FastAPI task

Setup

  • Clone project and run docker-compose up.
  • Check all is running OK docker-compose ps. All services must be in Up state.

Usage

GET
http://localhost:8888/GetStats
POST http://localhost:8888/AddTasks
Content-Type: application/json
{
  "taskid": "1",
  "description": "Description",
  "params": {
    "test1": "stringA",
    "test2": "stringB"
  }
}

TODO:

Make two services

  1. Service A two endpoints
    • /GetStats. Returns a single number — the number of successfully processed AddTasks calls since the service started.
    • /AddTasks. Adds messages to the queue, example:
{
  "taskid": "1",
  "description": "Description",
  "params": {
    "test1": "stringA",
    "test2": "stringB"
  }
}
  1. Service B aka Listener. When reading messages, it prints them to stdout.

Tech stack:

fastapi, aio-pika, rabbitmq

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages