pgmb
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 |
Archived upstream. Requires pg_cron and http; preload pg_cron in its configured database. RPM 1.0.0-2PGSTY fixes schema creation and requires pgsql_http; existing DEBs retain the upstream schema-creation failure. Delay arguments do not delay dispatch; retries have no exponential backoff.
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:
Create Extension:
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.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)