Skip to content

Instantly share code, notes, and snippets.

@grahamlyons
grahamlyons / tasks.py
Created August 16, 2025 08:47
Celery, using RabbitMQ, configured with retries and dead letter queues
"""
Run with: `celery -A tasks worker`
Expects a RabbitMQ to be served at `rabbitmq:5672` so will need adjustment if it is served on `localhost`.
"""
import logging
from typing import Dict, Tuple
from celery import Celery, Task
from kombu import Exchange, Queue