pgmb
pgmb : A simple PostgreSQL Message Broker system
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2670 | pgmb | pgmb | 1.0.0 |
FEAT | PostgreSQL | SQL |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| ----d-- | No | No | No | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | pgmb |
| Requires | pg_cron http |
| See Also | pgmq redis ulak pgq pgmqtt redis_fdw tcn pg_durable fsm_core kafka_fdw |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.0 |
18 17 16 15 14 | pgmb |
pg_cron, http |
| RPM | PIGSTY | 1.0.0 |
18 17 16 15 14 | pgmb_$v |
pg_cron_$v, pgsql_http_$v |
| DEB | PIGSTY | 1.0.0 |
18 17 16 15 14 | postgresql-$v-pgmb |
postgresql-$v-cron, postgresql-$v-http |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| el8.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| el9.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| el9.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| el10.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| el10.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| d12.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| d12.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| d13.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| d13.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| u22.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| u22.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| u24.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| u24.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| u26.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
| u26.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | PIGSTY 1.0.0 |
Source
github.com/fraruiz/pgmb
pgmb-1.0.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
pgmb implements a SQL message broker with worker endpoints, routing-key patterns, queues and HTTP dispatch scheduled through pg_cron. The upstream repository is archived.
Installation and compatibility
The RPM revision 1.0.0-2PGSTY requires pgsql_http_N and removes a redundant schema-creation statement. Earlier RPMs and existing DEB packages retain the upstream SQL and can fail at CREATE EXTENSION pgmb because the control file and install script both create the schema. Package installation alone does not establish that the extension can be created.
Install as a superuser. The required extensions are pg_cron and http; pgmb itself does not require preload. Configure the scheduler for the database in which the extension will be used:
Restart PostgreSQL, connect to that database, and create the dependencies before the extension:
Register a queue and send a message
The worker endpoint receives HTTP requests from the database server. Use a trusted endpoint and restrict who can register workers.
The argument order for pgmb.create is name, binding pattern, maximum retries, then worker UUID. A trigger routes messages to matching queues, and queue creation registers a scheduler job.
API
| Function | Purpose |
|---|---|
pgmb.worker(name, endpoint, rps) |
Register a worker and return its UUID; rps limits the batch size per dispatch. |
pgmb.create(name, binding_key, max_retries, worker_id) |
Create a queue, its dead-letter table and scheduler job; return the queue UUID. |
pgmb.send(id, routing_key, body) |
Store a JSONB message and route it to matching queues. |
pgmb.send overloads |
Accept optional headers and an integer-seconds or timestamp delay. |
pgmb.dispatch_messages(queue_id) |
Dispatch a batch; mark successful HTTP responses acknowledged, retry failures and move exhausted messages to the dead-letter table. |
Limits of version 1.0.0
- Delays populate
enqueued_at, but the dispatcher does not filter out future timestamps; the overloads do not guarantee delayed delivery. - Headers are stored with messages, but the dispatcher sends only the body using
http_post; they are not forwarded as custom HTTP headers. - Retries use a counter on subsequent dispatches. The SQL does not implement exponential backoff.
- HTTP effects are external to the database transaction. Review delivery and retention requirements before relying on this archived project.