pgmq4s
April 15, 2026 · View on GitHub
Scala 3 client for pgmq (Postgres Message Queue).
Note: This library is under active development. The API may contain breaking changes between releases.
Requires PGMQ v1.11.0+ (topic-based routing). Core messaging works with v1.10.0.
Supports JVM, Scala.js, and Scala Native.
Database backends:
- Anorm
- Doobie
- Skunk
- Slick
JSON codecs
- Circe
- Jsoniter-scala
- Play JSON
- Spray JSON
- uPickle
Need a specific DB backend or JSON bridge? Create an issue here.
Architecture
pgmq4s provides two main traits:
PgmqClient[F]— message operations (send, read, pop, archive, delete)PgmqAdmin[F]— queue management and observability (create, drop, list, metrics)
Each database backend provides both: e.g. DoobiePgmqClient + DoobiePgmqAdmin.
Getting Started
Add to your build.sbt (replace <version> with the latest version shown in the badge above):
libraryDependencies ++= Seq(
"io.github.matejcerny" %% "pgmq4s-circe" % "<version>", // or pgmq4s-jsoniter, pgmq4s-play-json, pgmq4s-spray-json, pgmq4s-upickle
"io.github.matejcerny" %% "pgmq4s-doobie" % "<version>" // or pgmq4s-anorm, pgmq4s-skunk, pgmq4s-slick
)
See the documentation for usage examples.