pgmb
A simple PostgreSQL Message Broker system
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgmb | 1.0.0 | FEAT | PostgreSQL | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2670 | pgmb | No | No | No | Yes | No | No | pgmb |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.0 | 1817161514 | pgmb | pg_cron, http |
| RPM | PIGSTY | 1.0.0 | 1817161514 | pgmb_$v | pg_cron_$v, pgsql_http_$v |
| DEB | PIGSTY | 1.0.0 | 1817161514 | postgresql-$v-pgmb | postgresql-$v-cron, postgresql-$v-http |
Build
You can build the RPM / DEB packages for pgmb using pig build:
Install
You can install pgmb directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
pgmb: A lightweight message broker system built inside PostgreSQL
The pgmb extension provides an in-database message broker with HTTP-based worker dispatch, automatic retries, dead letter queues, and pattern-based routing.
Register a Worker
Create a Queue
Send Messages
API Reference
| Function | Description |
|---|---|
pgmb.worker(name, endpoint, rps) | Register an HTTP worker endpoint |
pgmb.create(name, binding_key, max_retries, worker_id) | Create a queue with routing pattern |
pgmb.send(id, routing_key, body) | Send a message |
pgmb.send(id, routing_key, body, headers) | Send a message with headers |
pgmb.send(id, routing_key, body, headers, delay) | Send a delayed message |
How It Works
- Messages are inserted into
pgmb.messagesviapgmb.send() - A trigger routes messages to matching queues based on routing key patterns
pg_crondispatches messages via HTTP POST to worker endpoints every second- Failed messages are retried; after max retries they move to a dead letter queue
Monitoring
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)