Skip to content

Commit d561381

Browse files
maheshwaripRebeccaTamachiro
authored andcommitted
Updating queues pull consumer limits (#21244)
1 parent 367c2a2 commit d561381

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Increased limits for Queues pull consumers
3+
description: Queues now supports consuming up to 5,000 messages per second per queue over HTTP.
4+
products:
5+
- queues
6+
date: 2025-04-17 12:00:00 UTC
7+
---
8+
9+
[Queues pull consumers](/queues/configuration/pull-consumers/) can now pull and acknowledge up to **5,000 messages per second per queue**. Previously, pull consumers were rate limited to 1200 requests / 5 minutes, aggregated across all queues.
10+
11+
Pull consumers allow you to consume messages over HTTP from any environment—including outside of [Cloudflare Workers](/workers). They’re also useful when you need fine-grained control over how quickly messages are consumed.
12+
13+
To setup a new queue with a pull based consumer using [Wrangler](/workers/wrangler/), run:
14+
```bash title="Create a queue with a pull based consumer"
15+
$ npx wrangler queues create my-queue
16+
$ npx wrangler queues consumer http add my-queue
17+
```
18+
You can also configure a pull consumer using the [REST API](/api/resources/queues/subresources/consumers/methods/create/) or the Queues dashboard.
19+
20+
Once configured, you can pull messages from the queue using any HTTP client. You'll need a [Cloudflare API Token](/fundamentals/api/get-started/create-token/) with `queues_read` and `queues_write` permissions. For example:
21+
```bash title="Pull messages from a queue"
22+
curl "https://api.cloudflare.com/client/v4/accounts/${CF_ACCOUNT_ID}/queues/${QUEUE_ID}/messages/pull" \
23+
--header "Authorization: Bearer ${API_TOKEN}" \
24+
--header "Content-Type: application/json" \
25+
--data '{ "visibility_timeout": 10000, "batch_size": 2 }'
26+
```
27+
28+
To learn more about how to acknowledge messages, pull batches at once, and setup multiple consumers, refer to the [pull consumer documentation](/queues/configuration/pull-consumers).
29+
30+
As always, Queues doesn't charge for data egress. Pull operations continue to be billed at the [existing rate](/queues/platform/pricing), of $0.40 / million operations. The increased limits are available now, on all new and existing queues. If you're new to Queues, [get started with the Cloudflare Queues guide](/queues/get-started).

src/content/docs/queues/configuration/pull-consumers.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ curl "https://api.cloudflare.com/client/v4/accounts/${CF_ACCOUNT_ID}/queues/${QU
9696
--data '{ "visibility_timeout": 10000, "batch_size": 2 }'
9797
```
9898

99-
You may authenticate and run multiple concurrent pull-based consumers against a single queue, noting that all consumers will share the same [rate limit](/queues/platform/limits/) against the Cloudflare API.
99+
You may authenticate and run multiple concurrent pull-based consumers against a single queue.
100100

101101
### Create API tokens
102102

@@ -248,7 +248,7 @@ Additionally:
248248

249249
- You should provide every `lease_id` in the request to the `/ack` endpoint if you are processing those messages in your consumer. If you do not acknowledge a message, it will be marked for re-delivery (put back in the queue).
250250
- You can optionally mark messages to be retried: for example, if there is an error processing the message or you have upstream resource pressure. Explicitly marking a message for retry will place it back into the queue immediately, instead of waiting for a (potentially long) `visibility_timeout` to be reached.
251-
- You can make multiple calls to the `/ack` endpoint as you make progress through a batch of messages, but we recommend grouping acknowledgements to avoid hitting [API rate limits](/queues/platform/limits/).
251+
- You can make multiple calls to the `/ack` endpoint as you make progress through a batch of messages, but we recommend grouping acknowledgements to reduce the number of API calls required.
252252

253253
Queues aims to be permissive when it comes to lease IDs: if a consumer acknowledges a message by its lease ID _after_ the visibility timeout is reached, Queues will still accept that acknowledgment. If the message was delivered to another consumer during the intervening period, it will also be able to acknowledge the message without an error.
254254

src/content/docs/queues/platform/limits.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import { Render, WranglerConfig } from "~/components"
2525
| [Consumer CPU time](/workers/platform/limits/#cpu-time)| 30 seconds (default). [Configurable to 5 minutes](/queues/platform/limits/#increasing-queue-consumer-worker-cpu-limits) |
2626
| `visibilityTimeout` (pull-based queues) | 12 hours |
2727
| `delaySeconds` (when sending or retrying) | 12 hours |
28-
| Requests to the Queues API (incl. pulls/acks) | [1200 requests / 5 mins](/fundamentals/api/reference/limits/) |
29-
28+
| Requests to the Queues API (excluding pull consumer operations)<sup>6</sup> | [1200 requests / 5 mins](/fundamentals/api/reference/limits/) |
3029

3130

3231
<sup>1</sup> 1 KB is measured as 1000 bytes. Messages can include up to \~100 bytes of internal metadata that counts towards total message limits.
@@ -39,6 +38,8 @@ import { Render, WranglerConfig } from "~/components"
3938

4039
<sup>5</sup> Refer to [Workers limits](/workers/platform/limits/#cpu-time).
4140

41+
<sup>6</sup> [Pull Consumers](/queues/configuration/pull-consumers) allow you to consume messages from a queue over HTTP. Pulls, acknowledgements, and retries over HTTP are not subject to the API rate limit.
42+
4243
<Render file="limits_increase" product="workers" />
4344

4445
### Increasing Queue Consumer Worker CPU Limits

src/content/release-notes/queues.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ productLink: "/queues/"
55
productArea: Developer platform
66
productAreaLink: /workers/platform/changelog/platform/
77
entries:
8+
- publish_date: "2025-04-17"
9+
title: Improved limits for pull consumers
10+
description: |-
11+
[Queues Pull Consumers](/queues/configuration/pull-consumers/) can now pull and acknowledge up to 5,000 messages per second per queue. Previously, pull consumers were rate limited to 1200 requests / 5 minutes, aggregated across all queues.
12+
13+
Refer to the [documentation on pull consumers](/queues/configuration/pull-consumers/) to learn how to setup a pull consumer, acknowledge / retry messages, and setup multiple consumers.
814
- publish_date: "2025-03-27"
915
title: Pause delivery and purge queues
1016
description: |-

0 commit comments

Comments
 (0)