View Source Oban.Notifiers.PG (Oban v2.13.0)
A PG/PG2 based notifier implementation that runs with Distributed Erlang.
Out of the box, Oban uses PostgreSQL's
LISTEN/NOTIFY for PubSub. For most applications, that
is fine, but Postgres-based PubSub isn't sufficient in some circumstances. In particular,
Postgres notifications won't work when your application connects through PGbouncer in
transaction or statement mode.
Note: You must be using Distributed Erlang to use the PG notifier.
PG notifier in your Oban configuration:
config :my_app, Oban, notifier: Oban.Notifiers.PG, ...
The notifier will use
pgif available (OTP 23+) or fall back to
pg2for older OTP releases.
Like the Postgres implementation, notifications are namespaced by
For compatibility, message payloads are always serialized to JSON before broadcast and deserialized before relay to local processes.