Metadata-Version: 2.4
Name: django-celery-outbox
Version: 0.4.3
Summary: Transactional Outbox pattern for Celery tasks in Django
Author-email: Filipp Balakin <filipp@balakin.ru>
Maintainer-email: Filipp Balakin <filipp@balakin.ru>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Barsoomx/django-celery-outbox
Project-URL: Repository, https://github.com/Barsoomx/django-celery-outbox
Project-URL: Changelog, https://github.com/Barsoomx/django-celery-outbox/blob/master/CHANGELOG.md
Project-URL: Issues, https://github.com/Barsoomx/django-celery-outbox/issues
Keywords: celery,outbox,django,transactional-outbox,reliability
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Framework :: Celery
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Distributed Computing
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.2
Requires-Dist: celery>=5.3
Requires-Dist: structlog>=21.4.0
Requires-Dist: sentry-sdk>=2.0.0
Requires-Dist: datadog>=0.44.0
Provides-Extra: dev
Requires-Dist: ruff==0.15.17; extra == "dev"
Requires-Dist: django-stubs>=5.0.0; extra == "dev"
Requires-Dist: django-stubs-ext>=5.0.0; extra == "dev"
Requires-Dist: mypy>=1.8; extra == "dev"
Requires-Dist: celery-stubs; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: pytest-django>=4.5; extra == "test"
Requires-Dist: coverage[toml]>=7.6; extra == "test"
Requires-Dist: build>=1.2; extra == "test"
Requires-Dist: factory-boy>=3.3; extra == "test"
Requires-Dist: psycopg[binary]>=3.1; extra == "test"
Requires-Dist: mysqlclient>=2.2; extra == "test"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5; extra == "docs"
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Dynamic: license-file

# django-celery-outbox

[![Tests](https://github.com/Barsoomx/django-celery-outbox/actions/workflows/tests.yml/badge.svg)](https://github.com/Barsoomx/django-celery-outbox/actions/workflows/tests.yml)
[![CodeQL](https://github.com/Barsoomx/django-celery-outbox/actions/workflows/codeql.yml/badge.svg)](https://github.com/Barsoomx/django-celery-outbox/actions/workflows/codeql.yml)
[![codecov](https://codecov.io/github/Barsoomx/django-celery-outbox/graph/badge.svg?token=PKOXQWYZVD)](https://codecov.io/github/Barsoomx/django-celery-outbox)
[![PyPI version](https://img.shields.io/pypi/v/django-celery-outbox.svg)](https://pypi.org/project/django-celery-outbox/)
[![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://barsoomx.github.io/django-celery-outbox/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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 with Celery 5.3–5.6 on Python 3.10–3.12 in the general matrix, Django 5.2 on Python 3.13 and 3.14, Django 6.0 and 6.1 on Python 3.12 and 3.14, plus dedicated live-broker smoke coverage for Django 5.0 and 5.1. The Django 6.1 lanes run on PostgreSQL only: Django 6.1 requires MySQL 8.4, and the CI MySQL service runs 8.0. 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](https://codecov.io/github/Barsoomx/django-celery-outbox/graphs/tree.svg?token=PKOXQWYZVD)](https://codecov.io/github/Barsoomx/django-celery-outbox)

## Quick Start

```bash
pip install django-celery-outbox
```

```python
# settings.py
INSTALLED_APPS = [..., 'django_celery_outbox']
CELERY_OUTBOX_APP = 'myproject.celery.app'

# celery.py
from django_celery_outbox import OutboxCelery

app = OutboxCelery('myproject')
```

```bash
python manage.py migrate
python manage.py check --database default
python manage.py celery_outbox_relay
```

`check --database <alias>` verifies `SKIP LOCKED` support and the outbox schema on the alias that stores the outbox tables; a plain `check` validates settings only. See [Getting Started](https://barsoomx.github.io/django-celery-outbox/getting-started/).

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 →](https://barsoomx.github.io/django-celery-outbox/)**

## Security

See [Security Guide](https://barsoomx.github.io/django-celery-outbox/security/) for PII handling, traceback logging, and DLQ retention.

## License

MIT
