跳转到主要内容

pgmb

A simple PostgreSQL Message Broker system

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
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.

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
Package Version OS ORG SIZE File URL
pgmb_18 1.0.0 el8.x86_64 pigsty 12.4 KiB pgmb_18-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_18 1.0.0 el8.x86_64 pigsty 12.3 KiB pgmb_18-1.0.0-1PIGSTY.el8.x86_64.rpm
pgmb_18 1.0.0 el8.aarch64 pigsty 12.4 KiB pgmb_18-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_18 1.0.0 el8.aarch64 pigsty 12.3 KiB pgmb_18-1.0.0-1PIGSTY.el8.aarch64.rpm
pgmb_18 1.0.0 el9.x86_64 pigsty 12.4 KiB pgmb_18-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_18 1.0.0 el9.x86_64 pigsty 12.3 KiB pgmb_18-1.0.0-1PIGSTY.el9.x86_64.rpm
pgmb_18 1.0.0 el9.aarch64 pigsty 12.4 KiB pgmb_18-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_18 1.0.0 el9.aarch64 pigsty 12.2 KiB pgmb_18-1.0.0-1PIGSTY.el9.aarch64.rpm
pgmb_18 1.0.0 el10.x86_64 pigsty 12.5 KiB pgmb_18-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_18 1.0.0 el10.x86_64 pigsty 12.4 KiB pgmb_18-1.0.0-1PIGSTY.el10.x86_64.rpm
pgmb_18 1.0.0 el10.aarch64 pigsty 12.5 KiB pgmb_18-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_18 1.0.0 el10.aarch64 pigsty 12.4 KiB pgmb_18-1.0.0-1PIGSTY.el10.aarch64.rpm
postgresql-18-pgmb 1.0.0 d12.x86_64 pigsty 8.7 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~bookworm_amd64.deb
postgresql-18-pgmb 1.0.0 d12.aarch64 pigsty 8.7 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~bookworm_arm64.deb
postgresql-18-pgmb 1.0.0 d13.x86_64 pigsty 8.7 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~trixie_amd64.deb
postgresql-18-pgmb 1.0.0 d13.aarch64 pigsty 8.7 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~trixie_arm64.deb
postgresql-18-pgmb 1.0.0 u22.x86_64 pigsty 7.4 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~jammy_amd64.deb
postgresql-18-pgmb 1.0.0 u22.aarch64 pigsty 7.4 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~jammy_arm64.deb
postgresql-18-pgmb 1.0.0 u24.x86_64 pigsty 7.4 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~noble_amd64.deb
postgresql-18-pgmb 1.0.0 u24.aarch64 pigsty 7.4 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~noble_arm64.deb
postgresql-18-pgmb 1.0.0 u26.x86_64 pigsty 7.4 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~resolute_amd64.deb
postgresql-18-pgmb 1.0.0 u26.aarch64 pigsty 7.4 KiB postgresql-18-pgmb_1.0.0-1PIGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pgmb_17 1.0.0 el8.x86_64 pigsty 12.4 KiB pgmb_17-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_17 1.0.0 el8.x86_64 pigsty 12.3 KiB pgmb_17-1.0.0-1PIGSTY.el8.x86_64.rpm
pgmb_17 1.0.0 el8.aarch64 pigsty 12.4 KiB pgmb_17-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_17 1.0.0 el8.aarch64 pigsty 12.3 KiB pgmb_17-1.0.0-1PIGSTY.el8.aarch64.rpm
pgmb_17 1.0.0 el9.x86_64 pigsty 12.4 KiB pgmb_17-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_17 1.0.0 el9.x86_64 pigsty 12.3 KiB pgmb_17-1.0.0-1PIGSTY.el9.x86_64.rpm
pgmb_17 1.0.0 el9.aarch64 pigsty 12.4 KiB pgmb_17-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_17 1.0.0 el9.aarch64 pigsty 12.2 KiB pgmb_17-1.0.0-1PIGSTY.el9.aarch64.rpm
pgmb_17 1.0.0 el10.x86_64 pigsty 12.5 KiB pgmb_17-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_17 1.0.0 el10.x86_64 pigsty 12.4 KiB pgmb_17-1.0.0-1PIGSTY.el10.x86_64.rpm
pgmb_17 1.0.0 el10.aarch64 pigsty 12.5 KiB pgmb_17-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_17 1.0.0 el10.aarch64 pigsty 12.4 KiB pgmb_17-1.0.0-1PIGSTY.el10.aarch64.rpm
postgresql-17-pgmb 1.0.0 d12.x86_64 pigsty 8.7 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~bookworm_amd64.deb
postgresql-17-pgmb 1.0.0 d12.aarch64 pigsty 8.7 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~bookworm_arm64.deb
postgresql-17-pgmb 1.0.0 d13.x86_64 pigsty 8.8 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~trixie_amd64.deb
postgresql-17-pgmb 1.0.0 d13.aarch64 pigsty 8.7 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~trixie_arm64.deb
postgresql-17-pgmb 1.0.0 u22.x86_64 pigsty 7.4 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~jammy_amd64.deb
postgresql-17-pgmb 1.0.0 u22.aarch64 pigsty 7.4 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~jammy_arm64.deb
postgresql-17-pgmb 1.0.0 u24.x86_64 pigsty 7.4 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~noble_amd64.deb
postgresql-17-pgmb 1.0.0 u24.aarch64 pigsty 7.4 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~noble_arm64.deb
postgresql-17-pgmb 1.0.0 u26.x86_64 pigsty 7.4 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~resolute_amd64.deb
postgresql-17-pgmb 1.0.0 u26.aarch64 pigsty 7.4 KiB postgresql-17-pgmb_1.0.0-1PIGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pgmb_16 1.0.0 el8.x86_64 pigsty 12.4 KiB pgmb_16-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_16 1.0.0 el8.x86_64 pigsty 12.3 KiB pgmb_16-1.0.0-1PIGSTY.el8.x86_64.rpm
pgmb_16 1.0.0 el8.aarch64 pigsty 12.4 KiB pgmb_16-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_16 1.0.0 el8.aarch64 pigsty 12.3 KiB pgmb_16-1.0.0-1PIGSTY.el8.aarch64.rpm
pgmb_16 1.0.0 el9.x86_64 pigsty 12.4 KiB pgmb_16-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_16 1.0.0 el9.x86_64 pigsty 12.3 KiB pgmb_16-1.0.0-1PIGSTY.el9.x86_64.rpm
pgmb_16 1.0.0 el9.aarch64 pigsty 12.4 KiB pgmb_16-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_16 1.0.0 el9.aarch64 pigsty 12.2 KiB pgmb_16-1.0.0-1PIGSTY.el9.aarch64.rpm
pgmb_16 1.0.0 el10.x86_64 pigsty 12.5 KiB pgmb_16-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_16 1.0.0 el10.x86_64 pigsty 12.4 KiB pgmb_16-1.0.0-1PIGSTY.el10.x86_64.rpm
pgmb_16 1.0.0 el10.aarch64 pigsty 12.5 KiB pgmb_16-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_16 1.0.0 el10.aarch64 pigsty 12.4 KiB pgmb_16-1.0.0-1PIGSTY.el10.aarch64.rpm
postgresql-16-pgmb 1.0.0 d12.x86_64 pigsty 8.7 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~bookworm_amd64.deb
postgresql-16-pgmb 1.0.0 d12.aarch64 pigsty 8.7 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~bookworm_arm64.deb
postgresql-16-pgmb 1.0.0 d13.x86_64 pigsty 8.7 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~trixie_amd64.deb
postgresql-16-pgmb 1.0.0 d13.aarch64 pigsty 8.7 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~trixie_arm64.deb
postgresql-16-pgmb 1.0.0 u22.x86_64 pigsty 7.4 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~jammy_amd64.deb
postgresql-16-pgmb 1.0.0 u22.aarch64 pigsty 7.4 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~jammy_arm64.deb
postgresql-16-pgmb 1.0.0 u24.x86_64 pigsty 7.4 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~noble_amd64.deb
postgresql-16-pgmb 1.0.0 u24.aarch64 pigsty 7.4 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~noble_arm64.deb
postgresql-16-pgmb 1.0.0 u26.x86_64 pigsty 7.4 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~resolute_amd64.deb
postgresql-16-pgmb 1.0.0 u26.aarch64 pigsty 7.4 KiB postgresql-16-pgmb_1.0.0-1PIGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pgmb_15 1.0.0 el8.x86_64 pigsty 12.4 KiB pgmb_15-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_15 1.0.0 el8.x86_64 pigsty 12.3 KiB pgmb_15-1.0.0-1PIGSTY.el8.x86_64.rpm
pgmb_15 1.0.0 el8.aarch64 pigsty 12.4 KiB pgmb_15-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_15 1.0.0 el8.aarch64 pigsty 12.3 KiB pgmb_15-1.0.0-1PIGSTY.el8.aarch64.rpm
pgmb_15 1.0.0 el9.x86_64 pigsty 12.4 KiB pgmb_15-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_15 1.0.0 el9.x86_64 pigsty 12.3 KiB pgmb_15-1.0.0-1PIGSTY.el9.x86_64.rpm
pgmb_15 1.0.0 el9.aarch64 pigsty 12.4 KiB pgmb_15-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_15 1.0.0 el9.aarch64 pigsty 12.2 KiB pgmb_15-1.0.0-1PIGSTY.el9.aarch64.rpm
pgmb_15 1.0.0 el10.x86_64 pigsty 12.5 KiB pgmb_15-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_15 1.0.0 el10.x86_64 pigsty 12.4 KiB pgmb_15-1.0.0-1PIGSTY.el10.x86_64.rpm
pgmb_15 1.0.0 el10.aarch64 pigsty 12.5 KiB pgmb_15-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_15 1.0.0 el10.aarch64 pigsty 12.4 KiB pgmb_15-1.0.0-1PIGSTY.el10.aarch64.rpm
postgresql-15-pgmb 1.0.0 d12.x86_64 pigsty 8.8 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~bookworm_amd64.deb
postgresql-15-pgmb 1.0.0 d12.aarch64 pigsty 8.7 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~bookworm_arm64.deb
postgresql-15-pgmb 1.0.0 d13.x86_64 pigsty 8.8 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~trixie_amd64.deb
postgresql-15-pgmb 1.0.0 d13.aarch64 pigsty 8.7 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~trixie_arm64.deb
postgresql-15-pgmb 1.0.0 u22.x86_64 pigsty 7.4 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~jammy_amd64.deb
postgresql-15-pgmb 1.0.0 u22.aarch64 pigsty 7.4 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~jammy_arm64.deb
postgresql-15-pgmb 1.0.0 u24.x86_64 pigsty 7.4 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~noble_amd64.deb
postgresql-15-pgmb 1.0.0 u24.aarch64 pigsty 7.4 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~noble_arm64.deb
postgresql-15-pgmb 1.0.0 u26.x86_64 pigsty 7.4 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~resolute_amd64.deb
postgresql-15-pgmb 1.0.0 u26.aarch64 pigsty 7.4 KiB postgresql-15-pgmb_1.0.0-1PIGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pgmb_14 1.0.0 el8.x86_64 pigsty 12.4 KiB pgmb_14-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_14 1.0.0 el8.x86_64 pigsty 12.3 KiB pgmb_14-1.0.0-1PIGSTY.el8.x86_64.rpm
pgmb_14 1.0.0 el8.aarch64 pigsty 12.4 KiB pgmb_14-1.0.0-2PGSTY.el8.noarch.rpm
pgmb_14 1.0.0 el8.aarch64 pigsty 12.3 KiB pgmb_14-1.0.0-1PIGSTY.el8.aarch64.rpm
pgmb_14 1.0.0 el9.x86_64 pigsty 12.4 KiB pgmb_14-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_14 1.0.0 el9.x86_64 pigsty 12.2 KiB pgmb_14-1.0.0-1PIGSTY.el9.x86_64.rpm
pgmb_14 1.0.0 el9.aarch64 pigsty 12.4 KiB pgmb_14-1.0.0-2PGSTY.el9.noarch.rpm
pgmb_14 1.0.0 el9.aarch64 pigsty 12.2 KiB pgmb_14-1.0.0-1PIGSTY.el9.aarch64.rpm
pgmb_14 1.0.0 el10.x86_64 pigsty 12.5 KiB pgmb_14-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_14 1.0.0 el10.x86_64 pigsty 12.4 KiB pgmb_14-1.0.0-1PIGSTY.el10.x86_64.rpm
pgmb_14 1.0.0 el10.aarch64 pigsty 12.5 KiB pgmb_14-1.0.0-2PGSTY.el10.noarch.rpm
pgmb_14 1.0.0 el10.aarch64 pigsty 12.4 KiB pgmb_14-1.0.0-1PIGSTY.el10.aarch64.rpm
postgresql-14-pgmb 1.0.0 d12.x86_64 pigsty 8.8 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~bookworm_amd64.deb
postgresql-14-pgmb 1.0.0 d12.aarch64 pigsty 8.8 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~bookworm_arm64.deb
postgresql-14-pgmb 1.0.0 d13.x86_64 pigsty 8.7 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~trixie_amd64.deb
postgresql-14-pgmb 1.0.0 d13.aarch64 pigsty 8.7 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~trixie_arm64.deb
postgresql-14-pgmb 1.0.0 u22.x86_64 pigsty 7.4 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~jammy_amd64.deb
postgresql-14-pgmb 1.0.0 u22.aarch64 pigsty 7.4 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~jammy_arm64.deb
postgresql-14-pgmb 1.0.0 u24.x86_64 pigsty 7.4 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~noble_amd64.deb
postgresql-14-pgmb 1.0.0 u24.aarch64 pigsty 7.4 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~noble_arm64.deb
postgresql-14-pgmb 1.0.0 u26.x86_64 pigsty 7.4 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~resolute_amd64.deb
postgresql-14-pgmb 1.0.0 u26.aarch64 pigsty 7.4 KiB postgresql-14-pgmb_1.0.0-1PIGSTY~resolute_arm64.deb

Source

pig build pkg pgmb;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pgmb;		# install via package name, for the active PG version

pig install pgmb -v 18;   # install for PG 18
pig install pgmb -v 17;   # install for PG 17
pig install pgmb -v 16;   # install for PG 16
pig install pgmb -v 15;   # install for PG 15
pig install pgmb -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION pgmb CASCADE; -- requires pg_cron, http

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:

shared_preload_libraries = 'pg_cron'
cron.database_name = 'postgres'

Restart PostgreSQL, connect to that database, and create the dependencies before the extension:

CREATE EXTENSION pg_cron;
CREATE EXTENSION http;
CREATE EXTENSION pgmb;

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.

SELECT pgmb.create(
    'orders', 'order.*', 3,
    pgmb.worker('order_worker', 'http://127.0.0.1:8080/worker', 100)
);

SELECT pgmb.send(
    gen_random_uuid(), 'order.created', '{"order_id": 123}'::jsonb
);

SELECT * FROM pgmb.workers;
SELECT * FROM pgmb.queues;
SELECT * FROM pgmb.orders_queue;
SELECT * FROM pgmb.orders_dead_letter_queue;

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.