FeatureFuel
1

Queues: add a pgmq_public.set_vt wrapper so Data API consumers can extend or delay a message

Source: supabase/supabase#54363 · opened by @martijn00
The pgmq_public wrappers that Studio installs when Queues are exposed through the Data API (getExposeQueuesSQL in packages/pg-meta/src/sql/studio/database/queues.ts) cover send, send_batch, read, pop, archive and delete. There is no wrapper for pgmq.set_vt, so a consumer that reads through PostgREST or supabase.schema('pgmq_public').rpc(...) cannot change a message's visibility timeout after it has read it. That rules out two common worker patterns: • Heartbeats for long jobs. A worker reads with sleep_seconds := 30, and the job takes longer. Without set_vt it cannot extend its lease, so the message becomes visible again and a second worker picks it up while the first is still running. The only choice is a long timeout up front, which delays the retry when a worker really dies. • Backoff after a failure. A worker that fails a message would normally push it back with set_vt(queue, msg_id, delay) to retry after 30 s, then 2 min, and so on. Without it, the me…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests