New Pause & Purge APIs for Queues
Cloudflare Queues now offers new functionalities to pause message delivery and purge (delete) messages within a queue. These capabilities are valuable in several scenarios:
- If a consumer application encounters a bug or experiences downtime, message processing can be temporarily halted while the issue is resolved.
- Invalid messages might be introduced into a queue during development due to code changes; these can now be easily cleared from the backlog.
- When a queue accumulates a backlog of stale messages, it can be cleaned up to allow for the consumption of new, relevant messages.
To pause a queue, the pause-delivery command can be executed using Wrangler. Paused queues will still accept new messages. Resuming a queue is straightforward with the resume-delivery command.
Pause and resume a queue
$ wrangler queues pause-delivery my-queuePausing message delivery for queue my-queue.Paused message delivery for queue my-queue.
$ wrangler queues resume-delivery my-queueResuming message delivery for queue my-queue.Resumed message delivery for queue my-queue.
The purge operation permanently removes all messages from a queue. It is important to note that, unlike pausing, purging is an irreversible action.
Purge a queue
$ wrangler queues purge my-queue✔ This operation will permanently delete all the messages in queue my-queue. Type my-queue to proceed. … my-queuePurged queue 'my-queue'
These operations are also accessible via the Queues REST API or directly from the queue’s dashboard page.

This functionality is available for both new and existing queues. Further details can be found in the pause and purge documentation. For those new to Cloudflare Queues, a getting started guide is available.

