pgbus

Jobs & events on PostgreSQL

PostgreSQL-native job processing and event bus for Rails, built on PGMQ. ActiveJob, topic-routed events, worker recycling, and SSE streams — one database, no Redis.

Gemfile
gem "pgbus"

One database, no Redis

Jobs and events live in the Postgres you already run, on top of PGMQ. No Redis, no separate broker, no extra moving part to operate.

Drop-in ActiveJob adapter

Point Rails at :pgbus and every existing job enqueues through PGMQ — with dead-letter routing and retry backoff you didn't have to write.

Topic-routed event bus

Publish once; AMQP-style patterns (orders.#, payments.*) fan out to idempotent subscribers, deduplicated by event id.

Workers that recycle

max_jobs, max_memory_mb, and max_lifetime retire a worker before it leaks — the memory-bloat problem other backends leave to you.

Dead-letter queues

After max_retries failed reads (PGMQ's read_ct), a message routes to a _dlq queue instead of spinning forever.

Postgres-SSE streams

Broadcast live updates over Server-Sent Events straight from Postgres — a Turbo Streams transport with no Action Cable and no Redis.

Documentation

Getting started

Guide

Operations

Testing

Migrate

Reference