Dev.to
7/13/2026

The original title is: "Supabase Queues in Production: Dead-Letter Queues, Retries, and Poison Messages with pgmq"
Original: Supabase Queues in Production: Dead-Letter Queues, Retries, and Poison Messages with pgmq
Short summary
A production-focused guide to handling failure modes in Supabase Queues (pgmq), which lacks built-in dead-letter queues, retry limits, and failure alerting. Covers using the read_ct column as a retry counter, diverting failed messages to a DLQ, and monitoring with pgmq.metrics(). Includes complete SQL and worker code for all five failure modes tested on a real Supabase project.
- •pgmq has no built-in DLQ, retry limit, or failure alerting — you build all three yourself
- •Use read_ct column as a free retry counter and divert exceeded messages to a second queue
- •Monitor pgmq.metrics() on a schedule to alert when messages are stuck
- •Complete SQL and worker code provided for five production failure modes
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



