Skip to content
Get started
Get started
PostgreSQL Multi-Broker Examples
View Markdown
examples · postgresql · multi-broker

Three brokers. One database. Real work.

Launch a disposable PostgreSQL 19.0 cluster with three active bunqueue brokers and exercise queues, workers, events, retries, DLQ recovery, shared limits, and durable job graphs.

End-to-End HA Blueprint

Run two or more stateless brokers sharing one authoritative PostgreSQL 17-19 database

Broker A BUNQUEUE_BROKER_ID=a Broker B BUNQUEUE_BROKER_ID=b tx + NOTIFY Queues & Flows shared FIFO & DAGs Failover Ready fenced lease recovery authoritative state PostgreSQL 17-19 Schema v22 · SKIP LOCKED Walk through Docker setup, workers, reliability controls, flows, and live validation
Zero broker state: every broker coordinates claims with SKIP LOCKED, database-clock leases, and LISTEN/NOTIFY wakeups.

From the repository root with Docker running, run ./examples/postgres-multibroker/verify.sh — it creates an isolated Compose project, runs every scenario under a 60s deadline, and tears down all containers, volumes, networks, and local images on exit (including errors, timeouts, SIGINT, and SIGTERM).

SettingFleet rule
PostgreSQL URL & namespaceSame primary/HA endpoint; same namespace for shared queues (different to isolate envs)
Broker IDUnique, stable per active process (never static --scale)
Connection pool & versionBudget brokers * (poolSize + 1) plus headroom; identical binary version across all brokers

Functional correctness guide, not a throughput benchmark or PostgreSQL primary-failover certification. Next: build the Docker topology.