Skip to content

Installation

Install faststream-outbox

uv add faststream-outbox
pip install faststream-outbox
poetry add faststream-outbox

Requirements

  • Python 3.13+
  • PostgreSQL 12+
  • A running Postgres instance accessible via SQLAlchemy AsyncEngine

Postgres

If you don't have a Postgres instance, you can start one with Docker:

docker run -d -p 5432:5432 \
    -e POSTGRES_USER=outbox \
    -e POSTGRES_PASSWORD=outbox \
    -e POSTGRES_DB=outbox \
    postgres:17

Optional extras

The base install ships only the SQLAlchemy-driven polling broker. Each optional extra unlocks one feature; nothing else changes if you omit them.

Extra Install What it enables
asyncpg pip install 'faststream-outbox[asyncpg]' The asyncpg SQLAlchemy driver. Required to get LISTEN/NOTIFY short-circuit wakeups in the subscriber's fetch loop — without it the loop falls back to plain polling, which adds up to max_fetch_interval (default 10s) of idle latency between an INSERT and a dispatch.
fastapi pip install 'faststream-outbox[fastapi]' The faststream_outbox.fastapi.OutboxRouter — see FastAPI integration.
validate pip install 'faststream-outbox[validate]' Alembic, for broker.validate_schema() — see Schema validation. Calling validate_schema() without this extra raises ImportError; every other code path works.
prometheus pip install 'faststream-outbox[prometheus]' The PrometheusRecorder metrics adapter and native OutboxPrometheusMiddleware — see Observability.
opentelemetry pip install 'faststream-outbox[opentelemetry]' The OpenTelemetryRecorder metrics adapter and native OutboxTelemetryMiddleware — see Observability.

Combine extras with commas:

pip install 'faststream-outbox[asyncpg,fastapi,prometheus]'