You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Customize the retention period for a queue, starting from 60 seconds to a maximum of 14 days.
4
+
products:
5
+
- queues
6
+
date: 2025-02-14 12:00:00 UTC
7
+
---
8
+
9
+
You can customize a Queue's message retention period, starting from 60s to a maximum of 14 days. Visit the [queues docs](/queues/configuration/configure-queues#queue-configuration) to learn more.
10
+
11
+

12
+
13
+
By default, Queues retain messages for a default of 4 days. Previously, it was impossible to change the retention period.
14
+
15
+
With this update, you can retain messages for up to 14 days. Or if you want your consumer to only consume newer messages, you can set the message expiry period to be as short as 60 seconds.
16
+
17
+
You can customize the retention period on the Queues settings page on the dashboard, or using Wrangler:
This feature is available on all new and existing Queues. If you haven't used Cloudflare Queues before, [get started with our guide here](/queues/get-started).
Copy file name to clipboardExpand all lines: src/content/docs/queues/configuration/configure-queues.mdx
+31-14Lines changed: 31 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,13 @@ head:
9
9
10
10
---
11
11
12
-
import { WranglerConfig } from"~/components";
12
+
import { WranglerConfig, Type } from"~/components";
13
13
14
14
Cloudflare Queues can be configured using [Wrangler](/workers/wrangler/install-and-update/), the command-line interface for Cloudflare's Developer Platform, which includes [Workers](/workers/), [R2](/r2/), and other developer products.
15
15
16
-
Each Worker has a [Wrangler configuration file](/workers/wrangler/configuration/) that specifies environment variables, triggers, and resources, such as a Queue. To enable Worker-to-resource communication, you must set up a [binding](/workers/runtime-apis/bindings/) in your Worker project's Wrangler file.
16
+
Cloudflare Queues can be configured using [Wrangler](/workers/wrangler/install-and-update/), the command-line interface for Cloudflare's Developer Platform, which includes [Workers](/workers/), [R2](/r2/), and other developer products.
17
+
18
+
Each Producer and Consumer Worker has a [Wrangler configuration file](/workers/wrangler/configuration/) that specifies environment variables, triggers, and resources, such as a Queue. To enable Worker-to-resource communication, you must set up a [binding](/workers/runtime-apis/bindings/) in your Worker project's Wrangler file.
17
19
18
20
Use the options below to configure your queue.
19
21
@@ -25,7 +27,24 @@ Below are options for Queues, refer to the Wrangler documentation for a full ref
25
27
26
28
:::
27
29
28
-
## Producer
30
+
## Queue configuration
31
+
The following Queue level settings can be configured using Wrangler:
32
+
33
+
```sh
34
+
$ npx run wrangler queues update --delivery-delay-secs 60 --message-retention-period-secs 3000
A producer is a [Cloudflare Worker](/workers/) that writes to one or more queues. A producer can accept messages over HTTP, asynchronously write messages when handling requests, and/or write to a queue from within a [Durable Object](/durable-objects/). Any Worker can write to a queue.
31
50
@@ -43,19 +62,17 @@ To produce to a queue, set up a binding in your Wrangler file. These options sho
43
62
44
63
45
64
46
-
* <code>queue</code> string
65
+
* <code>queue</code> <Typetext="string" />
47
66
48
67
* The name of the Queue.
49
68
50
-
* <code>binding</code> string
69
+
* <code>binding</code> <Typetext="string" />
51
70
52
71
* The name of the binding, which is a JavaScript variable.
53
72
54
73
55
74
56
-
## Consumer
57
-
58
-
## Workers
75
+
## Consumer worker configuration
59
76
60
77
To consume messages from one or more queues, set up a binding in your Wrangler file. These options should be used when a Worker wants to receive messages from a queue.
61
78
@@ -78,32 +95,32 @@ Refer to [Limits](/queues/platform/limits) to review the maximum values for each
* The maximum number of concurrent consumers allowed to run at once. Leaving this unset will mean that the number of invocations will scale to the [currently supported maximum](/queues/platform/limits/).
109
126
* Refer to [Consumer concurrency](/queues/configuration/consumer-concurrency/) for more information on how consumers autoscale, particularly when messages are retried.
0 commit comments