No description
  • Python 99.4%
  • Dockerfile 0.6%
Find a file
2026-05-20 08:09:38 +02:00
tests/integration Generated base application 2026-05-20 08:09:38 +02:00
worker Generated base application 2026-05-20 08:09:38 +02:00
.env.example Generated base application 2026-05-20 08:09:38 +02:00
.gitignore Initial commit 2026-05-19 20:47:14 +02:00
.woodpecker.yml woodpecker fixes 2026-05-19 20:49:04 +02:00
AGENTS.md Initial commit 2026-05-19 20:47:14 +02:00
DISPATCH_WORKER_INSTRUCTION.md Initial commit 2026-05-19 20:47:14 +02:00
docker-compose.production.yml Generated base application 2026-05-20 08:09:38 +02:00
docker-compose.test.yml Generated base application 2026-05-20 08:09:38 +02:00
Dockerfile Generated base application 2026-05-20 08:09:38 +02:00
README.md Generated base application 2026-05-20 08:09:38 +02:00
requirements.txt Generated base application 2026-05-20 08:09:38 +02:00

Dispatch Worker

Standalone RabbitMQ dispatch worker that sends to Mailjet and immediately updates dispatch status in the internal API.

Run

python -m worker.dispatch_worker

Required environment variables

  • RABBITMQ_URL
  • RABBITMQ_PRIORITY_QUEUES (comma-separated, highest to lowest)
  • MAILJET_API_KEY
  • MAILJET_SECRET_KEY
  • DISPATCH_API_BASE_URL
  • DISPATCH_SYSTEM_API_KEY

Optional environment variables

  • WORKER_IDLE_SLEEP_MS (default 150)
  • WORKER_PREFETCH_COUNT (default 10)
  • WORKER_REQUEST_TIMEOUT_SECONDS (default 15)
  • WORKER_MAX_RETRIES (default 5)

Behavior summary

  • Strict queue priority polling using ordered RABBITMQ_PRIORITY_QUEUES
  • Ack only after Mailjet accepts and callback returns HTTP 200
  • Validation errors rejected without requeue
  • Transient failures nacked with requeue
  • Mailjet 4xx failures retried with bounded retry header, then dead-letter flow

Tests

python -m pytest