PostgresEventBridge stores event payloads in a Postgres table and uses LISTEN/NOTIFY for low-latency fanout.
Optional dependencies
- Python
- TypeScript
Install the Postgres extra (recommended):Equivalent direct dependency install:
Constructor params
table_url:postgresql://user:pass@host:5432/dbname[/tablename]?...channel: optional notify/listen channel (defaults toabxbus_events)name: optional bridge label
- Python
- TypeScript
Setup with a bus
- Python
- TypeScript
Behavior
emit(...)upserts event payload data into the bridge table, then sendsNOTIFYwith the event id.on(...)registers inbound handlers and auto-starts listener startup.- On notifications, the bridge fetches the full row payload, reconstructs an event, resets it, and emits locally.
- Columns are created on demand only for
event_*fields. - The full event JSON is stored in
event_payload(not just non-event_*fields). event_*columns are also stored as flat mirrored fields for indexing/querying.- Rehydration merges
event_payloadwithevent_*column values back into a flat event object. - Runtime requirements: Python needs
asyncpg, TypeScript needspgand Node.js.