Skip to content

Commit dde774a

Browse files
committed
Added documentation for purging
1 parent 4a502a9 commit dde774a

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/content/docs/queues/configuration/pause-purge.mdx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2-
title: Pause delivery
2+
title: Pause and purge Queues
33
pcx_content_type: concept
44
sidebar:
55
order: 2
66
---
77
import { WranglerConfig, Type, MetaInfo } from "~/components";
88

9+
## Pause Delivery
910

1011
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.
1112

@@ -28,5 +29,25 @@ $ npx run wrangler queues resume-delivery <QUEUE-NAME>
2829
- `queue-name` <Type text="string" /> <MetaInfo text="required" />
2930
- The name of the queue from which delivery should be resumed.
3031

31-
### Using HTTP Pull consumers with a paused queue
32-
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`.
32+
### What happens to HTTP Pull consumers with a paused queue?
33+
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`.
34+
35+
## Purge queue
36+
Purging a queue permanently deletes any messages currently stored in the Queue. Purging is useful while developing a new application, especially to clear out any test data. It can also be useful in production to handle scenarios when a batch of bad messages have been sent to a Queue.
37+
38+
Note that any in flight messages, which are currently being processed by consumers, might still be processed. Messages sent to a queue during a purge operation might not be purged. Any delayed messages will also be deleted from the Queue.
39+
40+
:::note
41+
Purging a queue is an irreversible operation. Make sure to use this operation carefully.
42+
:::
43+
44+
### Purge queue using wrangler
45+
The following command will purge messages from your Queue. You will be prompted to enter the Queue name to confirm the operation.
46+
```sh
47+
$ npx run wrangler queues purge <QUEUE-NAME>
48+
49+
🚨This operation will permanently delete all the messages in Queue <name>. Type <name> to proceed.
50+
```
51+
52+
### Does purging my queue affect my bill?
53+
Purging a Queue counts as a single billable operation. For example, if you purge a Queue which has 100 messages, all 100 messages will be permanently deleted, and you will be billed for 1 billable operation. Refer to the [pricing](/queues/platform/pricing) page for more information about how Queues is billed.

0 commit comments

Comments
 (0)