From 1e30bfb7fd6aad5d4e5b4a2fa69e0117dea94dea Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Tue, 25 Feb 2025 14:39:10 -0500 Subject: [PATCH 01/10] Added commmands to pause and resume queue delivery --- .../docs/workers/wrangler/commands.mdx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index f66254286493776..4266af5817cbcaa 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -1348,6 +1348,25 @@ wrangler queues consumer remove +### `pause-delivery` + +Pause message delivery from a Queue to consumers (including push consumers, and HTTP pull consumers) + +```txt +wrangler queues pause-delivery +``` +- `queue-name` + - 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` + - The name of the queue from which delivery should be resumed. + --- ## `login` From 396a7c9cecf0c1e6bee5f0c742afbaf25a76c297 Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Tue, 25 Feb 2025 14:53:20 -0500 Subject: [PATCH 02/10] Added documentation to pause queues --- .../docs/queues/configuration/pause-purge.mdx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/content/docs/queues/configuration/pause-purge.mdx diff --git a/src/content/docs/queues/configuration/pause-purge.mdx b/src/content/docs/queues/configuration/pause-purge.mdx new file mode 100644 index 000000000000000..73b3ea030b4ac99 --- /dev/null +++ b/src/content/docs/queues/configuration/pause-purge.mdx @@ -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` + - 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` + - 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`. \ No newline at end of file From 4a502a9220c04f62c0f343fe7db95881d403f90c Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Tue, 25 Feb 2025 14:54:57 -0500 Subject: [PATCH 03/10] Update src/content/docs/queues/configuration/pause-purge.mdx Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> --- src/content/docs/queues/configuration/pause-purge.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/queues/configuration/pause-purge.mdx b/src/content/docs/queues/configuration/pause-purge.mdx index 73b3ea030b4ac99..c2d3dfb7a1a5f59 100644 --- a/src/content/docs/queues/configuration/pause-purge.mdx +++ b/src/content/docs/queues/configuration/pause-purge.mdx @@ -11,7 +11,7 @@ You can pause delivery of messages from your Queue to any connected consumers. P 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). +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: From dde774af29f38a4439d7fd6b7a47ac97763e2d46 Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Mon, 17 Mar 2025 17:51:09 -0400 Subject: [PATCH 04/10] Added documentation for purging --- .../docs/queues/configuration/pause-purge.mdx | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/content/docs/queues/configuration/pause-purge.mdx b/src/content/docs/queues/configuration/pause-purge.mdx index c2d3dfb7a1a5f59..62337b5b076f106 100644 --- a/src/content/docs/queues/configuration/pause-purge.mdx +++ b/src/content/docs/queues/configuration/pause-purge.mdx @@ -1,11 +1,12 @@ --- -title: Pause delivery +title: Pause and purge Queues pcx_content_type: concept sidebar: order: 2 --- import { WranglerConfig, Type, MetaInfo } from "~/components"; +## Pause Delivery 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. @@ -28,5 +29,25 @@ $ npx run wrangler queues resume-delivery - `queue-name` - 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`. \ No newline at end of file +### What happens to 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`. + +## Purge queue +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. + +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. + +:::note +Purging a queue is an irreversible operation. Make sure to use this operation carefully. +::: + +### Purge queue using wrangler +The following command will purge messages from your Queue. You will be prompted to enter the Queue name to confirm the operation. +```sh +$ npx run wrangler queues purge + +🚨This operation will permanently delete all the messages in Queue . Type to proceed. +``` + +### Does purging my queue affect my bill? +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. From c82f484bc76982e686f2f6e340d642a7d9f8fd3b Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Mon, 17 Mar 2025 17:54:34 -0400 Subject: [PATCH 05/10] Updated purge command --- src/content/docs/workers/wrangler/commands.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index 4266af5817cbcaa..f9fc52e70fa79e4 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -1348,6 +1348,16 @@ wrangler queues consumer remove +### `purge` + +Permanently delete all messages in a queue. + +```txt +wrangler queues purge +``` +- `queue-name` + - The name of the queue which delivery should be purged. + ### `pause-delivery` Pause message delivery from a Queue to consumers (including push consumers, and HTTP pull consumers) From e6b4b2bee47c638a94dad9b8f18c00a41b9ec6ca Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Mon, 17 Mar 2025 17:55:00 -0400 Subject: [PATCH 06/10] Fixed typos --- src/content/docs/queues/configuration/pause-purge.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/queues/configuration/pause-purge.mdx b/src/content/docs/queues/configuration/pause-purge.mdx index 62337b5b076f106..0a0c58c7b9a014e 100644 --- a/src/content/docs/queues/configuration/pause-purge.mdx +++ b/src/content/docs/queues/configuration/pause-purge.mdx @@ -49,5 +49,5 @@ $ npx run wrangler queues purge 🚨This operation will permanently delete all the messages in Queue . Type to proceed. ``` -### Does purging my queue affect my bill? +### Does purging a Queue affect my bill? 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. From 0f045a211520e891138233c01efe80c530ea5559 Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Mon, 17 Mar 2025 17:55:39 -0400 Subject: [PATCH 07/10] Improved language --- src/content/docs/queues/configuration/pause-purge.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/queues/configuration/pause-purge.mdx b/src/content/docs/queues/configuration/pause-purge.mdx index 0a0c58c7b9a014e..db4f1fc804983a4 100644 --- a/src/content/docs/queues/configuration/pause-purge.mdx +++ b/src/content/docs/queues/configuration/pause-purge.mdx @@ -50,4 +50,4 @@ $ npx run wrangler queues purge ``` ### Does purging a Queue affect my bill? -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. +Purging a Queue counts as a single billable operation, regardless of how many messages are deleted. 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. From 888cde098335aa1c42da6391f3b4686e19522d91 Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Tue, 18 Mar 2025 10:03:43 +0000 Subject: [PATCH 08/10] Apply suggestions from code review --- .../docs/queues/configuration/pause-purge.mdx | 17 +++++++++++------ src/content/docs/workers/wrangler/commands.mdx | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/content/docs/queues/configuration/pause-purge.mdx b/src/content/docs/queues/configuration/pause-purge.mdx index db4f1fc804983a4..62dad5ef9918adb 100644 --- a/src/content/docs/queues/configuration/pause-purge.mdx +++ b/src/content/docs/queues/configuration/pause-purge.mdx @@ -8,26 +8,31 @@ import { WranglerConfig, Type, MetaInfo } from "~/components"; ## Pause Delivery -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. +You can pause delivery of messages from your Queue to any connected consumers. Pausing a Queue is useful when managing downtime (for example, 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). +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` - - The name of the queue which delivery should be paused. + - The name of the queue for which delivery should be paused. The following command will resume message delivery: + ```sh $ npx run wrangler queues resume-delivery ``` + - `queue-name` - - The name of the queue from which delivery should be resumed. + - The name of the queue for which delivery should be resumed. ### What happens to 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`. @@ -37,11 +42,11 @@ Purging a queue permanently deletes any messages currently stored in the Queue. 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. -:::note +:::caution Purging a queue is an irreversible operation. Make sure to use this operation carefully. ::: -### Purge queue using wrangler +### Purge queue using Wrangler The following command will purge messages from your Queue. You will be prompted to enter the Queue name to confirm the operation. ```sh $ npx run wrangler queues purge diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index f9fc52e70fa79e4..c3abc388bfbc93c 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -1356,7 +1356,7 @@ Permanently delete all messages in a queue. wrangler queues purge ``` - `queue-name` - - The name of the queue which delivery should be purged. + - The name of the queue for which delivery should be purged. ### `pause-delivery` From 386de7d2cede94ca188c9d4a4bd7f011b63b81af Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Fri, 21 Mar 2025 12:29:53 -0400 Subject: [PATCH 09/10] Update pause-purge.mdx --- .../docs/queues/configuration/pause-purge.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/queues/configuration/pause-purge.mdx b/src/content/docs/queues/configuration/pause-purge.mdx index 62dad5ef9918adb..42f5a25bc181e6b 100644 --- a/src/content/docs/queues/configuration/pause-purge.mdx +++ b/src/content/docs/queues/configuration/pause-purge.mdx @@ -1,5 +1,5 @@ --- -title: Pause and purge Queues +title: Pause and Purge pcx_content_type: concept sidebar: order: 2 @@ -8,7 +8,7 @@ import { WranglerConfig, Type, MetaInfo } from "~/components"; ## Pause Delivery -You can pause delivery of messages from your Queue to any connected consumers. Pausing a Queue is useful when managing downtime (for example, if your consumer Worker is unhealthy) without losing any messages. +You can pause delivery of messages from your queue to any connected consumers. Pausing a queue is useful when managing downtime (for example, 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. @@ -40,19 +40,19 @@ When a queue is paused, messages cannot be pulled by an [HTTP pull based consume ## Purge queue 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. -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. +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. :::caution Purging a queue is an irreversible operation. Make sure to use this operation carefully. ::: ### Purge queue using Wrangler -The following command will purge messages from your Queue. You will be prompted to enter the Queue name to confirm the operation. +The following command will purge messages from your queue. You will be prompted to enter the queue name to confirm the operation. ```sh $ npx run wrangler queues purge -🚨This operation will permanently delete all the messages in Queue . Type to proceed. +This operation will permanently delete all the messages in Queue . Type to proceed. ``` ### Does purging a Queue affect my bill? -Purging a Queue counts as a single billable operation, regardless of how many messages are deleted. 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. +Purging a queue counts as a single billable operation, regardless of how many messages are deleted. 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. From bf0138680f7d0005fdd1138941fbb2a7a2e5fd80 Mon Sep 17 00:00:00 2001 From: Pranshu Maheshwari Date: Fri, 21 Mar 2025 12:57:14 -0400 Subject: [PATCH 10/10] Update commands.mdx --- src/content/docs/workers/wrangler/commands.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index c3abc388bfbc93c..37130222ec2f7bc 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -1356,7 +1356,7 @@ Permanently delete all messages in a queue. wrangler queues purge ``` - `queue-name` - - The name of the queue for which delivery should be purged. + - The name of the queue from which messages should be deleted. ### `pause-delivery`