Declarative consumers
Annotate a method with @PgmqListener(queue = "...") and it receives messages, like Spring Kafka.
Spring Boot library
Durable queues in PostgreSQL, the Spring way.
An idiomatic Spring Boot integration for the PGMQ PostgreSQL message queue. When your data already lives in PostgreSQL, it can replace a separate broker for application-scale asynchronous work, with the developer experience of Spring Kafka or Spring AMQP and the ACID guarantees of PostgreSQL.
@PgmqListener(queue = "orders")
public void handle(OrderCreated event) {
shipping.schedule(event.orderId());
}
// Sent in the same transaction as your data
pgmqTemplate.send("orders", new OrderCreated(id));
Annotate a method with @PgmqListener(queue = "...") and it receives messages, like Spring Kafka.
Send messages inside your normal @Transactional methods, so data and messages commit together.
Messages that keep failing move to a dead-letter queue after a configurable number of retries.
Visibility timeouts grow with each failure, relieving struggling downstream APIs.
Durable PGMQ reads combined with PostgreSQL LISTEN/NOTIFY, with periodic polling as a safety net.
Batching with List<T> parameters, concurrent consumers, delayed messages, Micrometer metrics and native-image hints.
A Spring Boot auto-configuration module between PGMQ and your application:
PgmqTemplate serialises your objects to JSONB with the application ObjectMapper.
@PgmqListener containers with polling or notification mode, batching and concurrency.
Outbox, transactional deduplication, retries, backoff and dead-letter routing.
Micrometer metrics (throughput, latency, queue depth), SpEL configuration and graceful shutdown.
git clone https://github.com/esgaltur/pgmq-spring-boot-starter.git
cd pgmq-spring-boot-starter
mvn install # not on Maven Central yet
# then in your pom.xml:
# io.github.esgaltur:pgmq-spring-boot-starter:0.0.1-SNAPSHOT
The full documentation is in the repository on GitHub.