Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Minimal example utilizing fastapi and celery with RabbitMQ for task queue, Redis for celery backend and flower for monitoring the celery tasks.

NotificationsYou must be signed in to change notification settings

GregaVrbancic/fastapi-celery

Repository files navigation

Minimal example utilizing FastAPI and Celery with RabbitMQ for task queue, Redis for Celery backend and flower for monitoring the Celery tasks.

Requirements

Run example

  1. Run commanddocker-compose upto start up the RabbitMQ, Redis, flower and our application/worker instances.
  2. Navigate to thehttp://localhost:8000/docs and execute test API call. You can monitor the execution of the celery tasks in the console logs or navigate to the flower monitoring app athttp://localhost:5555 (username: user, password: test).

Run application/worker without Docker?

Requirements/dependencies

  • Python >= 3.7
  • RabbitMQ instance
  • Redis instance

The RabbitMQ, Redis and flower services can be started withdocker-compose -f docker-compose-services.yml up

Install dependencies

Execute the following command:poetry install --dev

Run FastAPI app and Celery worker app

  1. Start the FastAPI web application withpoetry run hypercorn app/main:app --reload.
  2. Start the celery worker with commandpoetry run celery worker -A app.worker.celery_worker -l info -Q test-queue -c 1
  3. Navigate to thehttp://localhost:8000/docs and execute test API call. You can monitor the execution of the celery tasks in the console logs or navigate to the flower monitoring app athttp://localhost:5555 (username: user, password: test).

About

Minimal example utilizing fastapi and celery with RabbitMQ for task queue, Redis for celery backend and flower for monitoring the celery tasks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp