Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Pause message delivery #20284

Draft
wants to merge 3 commits into
base: production
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/content/docs/queues/configuration/pause-purge.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Pause delivery
pcx_content_type: concept
sidebar:
order: 2
---
import { WranglerConfig, Type, MetaInfo } from "~/components";


You can pause delivery of messages from your Queue to any connected consumers. Pausing a queue is useful to manage downtime (such as if your consumer Worker is unhealthy), without losing any messages.

Queues continue to receive and store messages even while delivery is paused. Messages in a paused queue are still subject to expiry, if the messages become older than the queue message retention period.

Pausing affects both [push-based consumer Workers](/queues/reference/how-queues-works#consumers), and [pull based consumers](/queues/configuration/pull-consumers).

### Pause and resume delivery using Wrangler
The following command will pause message delivery from your queue:
```sh
$ npx run wrangler queues pause-delivery <QUEUE-NAME>
```
- `queue-name` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue which delivery should be paused.

The following command will resume message delivery:
```sh
$ npx run wrangler queues resume-delivery <QUEUE-NAME>
```
- `queue-name` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue from which delivery should be resumed.

### Using HTTP Pull consumers with a paused queue
When a queue is paused, messages cannot be pulled by an [HTTP pull based consumer](/queues/configuration/pull-consumers). Requests to pull messages will receive a `409` response, along with an error message stating `queue_delivery_paused`.
19 changes: 19 additions & 0 deletions src/content/docs/workers/wrangler/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,25 @@ wrangler queues consumer remove <queue-name> <script-name>

<Render file="wrangler-commands/global-flags" product="workers" />

### `pause-delivery`

Pause message delivery from a Queue to consumers (including push consumers, and HTTP pull consumers)

```txt
wrangler queues pause-delivery <queue-name>
```
- `queue-name` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue which delivery should be paused.

### `resume-delivery`

Resume delivery from a Queue to consumers (including push consumers, and HTTP pull consumers)
```txt
wrangler queues resume-delivery <queue-name>
```
- `queue-name` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue from which delivery should be resumed.

---

## `login`
Expand Down
Loading