Skip to content

Commit

Permalink
queues: minor clarity improvements (#13612)
Browse files Browse the repository at this point in the history
* queues: Update pull-consumers.md

* queues: Update how-queues-works.md

* queues: Apply suggestions from code review

Co-authored-by: Maddy <130055405+Maddy-Cloudflare@users.noreply.github.com>

---------

Co-authored-by: Maddy <130055405+Maddy-Cloudflare@users.noreply.github.com>
  • Loading branch information
elithrar and Maddy-Cloudflare authored Mar 26, 2024
1 parent 0868dbe commit a6f31e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions content/queues/reference/how-queues-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,15 @@ To remove a queue from your project, run `wrangler queues consumer remove <queue
### Pull consumers
A queue can have a HTTP-based consumer that pulls from the queue, instead of messages being pushed to a Worker. This consumer can be any HTTP-speaking service that can communicate over the Internet. Review the [pull consumers](/queues/reference/pull-consumers/) to learn how to configure a pull-based consumer.
A queue can have a HTTP-based consumer that pulls from the queue, instead of messages being pushed to a Worker.
This consumer can be any HTTP-speaking service that can communicate over the Internet. Review the [pull consumer guide](/queues/reference/pull-consumers/) to learn how to configure a pull-based consumer for a queue.
## Messages
A message is the object you are producing to and consuming from a queue. Any serializable object can be published to a queue: for most developers, this means either simple strings or JSON objects.
A message is the object you are producing to and consuming from a queue.
Any JSON serializable object can be published to a queue. For most developers, this means either simple strings or JSON objects. You can explicitly [set the content type](#content-types) when sending a message.
Messages themselves can be [batched when delivered to a consumer](/queues/reference/batching-retries/). By default, messages within a batch are treated as all or nothing when determining retries. If the last message in a batch fails to be processed, the entire batch will be retried. You can also choose to [explictly acknowledge](/queues/reference/batching-retries/) messages as they are successfully processed, and/or mark individual messages to be retried.
Messages themselves can be batched when delivered to the consumer, and messages within a batch are treated as all or nothing when determining retries. If the last message in a batch fails to be processed, the entire batch will be retried.
2 changes: 1 addition & 1 deletion content/queues/reference/pull-consumers.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A pull-based consumer allows you to pull from a queue over HTTP from any environ

Deciding whether to configure a push-based consumer or a pull-based consumer will depend on how you are using your queues, as well as the configuration of infrastructure upstream from your queue consumer.

- Starting with a [push-based consumer](/queues/reference/how-queues-works/#consumers) is the easiest way to get started and consume from a queue. A push-based consumer runs on Workers, and by default, will automatically scale up and consume messages as they are written to the queue.
- **Starting with a [push-based consumer](/queues/reference/how-queues-works/#consumers) is the easiest way to get started and consume from a queue**. A push-based consumer runs on Workers, and by default, will automatically scale up and consume messages as they are written to the queue.
- Use a pull-based consumer if you need to consume messages from existing infrastucture outside of Cloudflare Workers, and/or where you need to carefully control how fast messages are consumed. A pull-based consumer must explicitly make a call to pull (and then acknowledge) messages from the queue, only when it is ready to do so.

You can remove and attach a new consumer on a queue at any time, allowing you to change from a pull-based to a push-based consumer if your requirements change.
Expand Down

0 comments on commit a6f31e4

Please sign in to comment.