Skip to main content

Transactional Outbox pattern for Celery tasks in Django

Project description

django-celery-outbox

Tests CodeQL codecov PyPI version Docs License: MIT

Transactional Outbox pattern for Celery tasks in Django.

Features

  • Durable persistence for committed task intents
  • Duplicate-tolerant relay recovery
  • Automatic retry with capped exponential backoff
  • Dead letter queue for exhausted retries
  • Structlog & Sentry trace propagation
  • StatsD metrics
  • Django admin integration

Compatibility

CI exercises Django 4.2 and 5.2 in the general matrix, plus dedicated live-broker smoke coverage for Django 5.0 and 5.1. The support claims in this repository stay aligned with those explicit lanes.

Coverage

Canonical coverage is published from the Py3.12 / Django 5.2 / Celery 5.6 / PostgreSQL lane in GitHub Actions.

Codecov Tree Graph

Quick Start

pip install django-celery-outbox
# settings.py
INSTALLED_APPS = [..., 'django_celery_outbox']
CELERY_OUTBOX_APP = 'myproject.celery.app'

# celery.py
from django_celery_outbox import OutboxCelery

app = OutboxCelery('myproject')
python manage.py migrate
python manage.py check
python manage.py celery_outbox_relay

Committed rows stay in the outbox until the relay publishes them or dead-letters them, but consumers still need to be idempotent. If the relay crashes after a broker publish and before cleanup, stale-timeout recovery can reclaim and resend the row. Stronger end-to-end guarantees still depend on broker confirms; without publisher confirms, the broker can fail ambiguously after Celery.send_task() returns.

Full Documentation →

Security

See Security Guide for PII handling, traceback logging, and DLQ retention.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_celery_outbox-0.4.0.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_celery_outbox-0.4.0-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

Details for the file django_celery_outbox-0.4.0.tar.gz.

File metadata

  • Download URL: django_celery_outbox-0.4.0.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for django_celery_outbox-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d35d1adec052b2d16a78f76a9db11967986fcc9d40820c243d65c8ce30867d02
MD5 f8d801e920ad45bd2003fa0cad59f7f7
BLAKE2b-256 d2ee25e2c634d06b44f225f1241edfa2568801a8f0f933cfcfb39dc0e0ed2f8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_celery_outbox-0.4.0.tar.gz:

Publisher: publish.yml on Barsoomx/django-celery-outbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_celery_outbox-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_celery_outbox-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af094b84909d464ed40a6065fc934684ca389d0b327ac965169520418a74ffd4
MD5 dcb84158dc95f093f55d6b5a7baabbc9
BLAKE2b-256 90d4e50848102a93bf786c478f9adfd6112c14b0aeb9557f7a72d2d6ec8e4098

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_celery_outbox-0.4.0-py3-none-any.whl:

Publisher: publish.yml on Barsoomx/django-celery-outbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page