Skip to main content

Messages are not being delivered

A nonempty queue is not necessarily ready to return work. Deliveries can be delayed, leased, exhausted, or blocked behind a FIFO group head. First distinguish missing deliveries from retained deliveries that are not currently claimable.

Inspect the subscription and state​

Run in the database used by the affected application:

SELECT * FROM postgremq.list_queues() WHERE queue_name = 'jobs';
SELECT * FROM postgremq.queue_metrics() WHERE queue_name = 'jobs';
SELECT * FROM postgremq.get_queue_statistics('jobs');
SELECT * FROM postgremq.list_messages('jobs');
SELECT * FROM postgremq.list_dlq_messages() WHERE queue_name = 'jobs';

No queue row means the subscription is absent. A queue_metrics() row with active = 0 identifies an expired Exclusive queue; list_queues() has no active column. Neither can recover historical publications simply by creating a new queue now.

If a specific publication is in question, inspect its ID with get_message(id). The payload's presence does not establish that this queue was subscribed when publication happened. Check the topic, queue declaration timing, transaction commit, and application logs. Publishing can succeed with no live subscriptions.

Read the state correctly​

ObservationLikely next check
delayed is nonzeroCheck the requested delivery time or nack delay against database time.
processing is nonzeroCheck active workers, lease extension, and processing duration.
exhausted persistsCheck fast maintenance; no further ordinary claim is allowed.
dead_letter growsInvestigate the failure cause before replay.
ready grows but claims return littleInspect FIFO heads, database lock waits, consumer capacity, and topic configuration.
Raw completed_count is largeWork already completed; retention, not consumption, removes that history.

ready includes visible group successors blocked behind their head. In list_messages, compare group keys and sequences with the earliest unsettled delivery in each group. A delayed or repeatedly failing head can explain a backlog that extra workers cannot resolve.

Do not delete a head merely to make counts fall. That discards its delivery and changes ordering consequences. Use the application's retry or DLQ recovery policy.

Check consumers and database access​

Confirm the application is iterating its stream or has started a handler consumer, and is observing termination errors. In TypeScript, creating a stream consumer without calling messages() does not start reception. The call starts reception even before the application reads from the iterator. For independently deployed Go or TypeScript consumers, supply the queue's topic when it was not declared on that connection.

Check runtime grants, writable-primary connectivity, available pool connections, and query errors. A blocked handler or a pool occupied by business transactions can starve claims and settlements. Listener sessions need capacity too.

Notifications are hints. Missed notifications should be recovered through polling; check polling configuration and listener errors if latency appears only after quiet periods. Do not use the notification stream as proof that a message was stored or lost.

Verify recovery​

After addressing the cause, publish a distinct test message through the normal runtime role to an intended test subscription. Confirm receipt and acknowledgement, then observe the original queue's age and completion progress.

If state is missing after a database incident, use the recovery plan. Recreating topology is not a substitute for determining which committed data survived.