Skip to content

Clarify that separate producer and consumer Workers for Queues can be run locally with wrangler dev #21208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sev3e3e opened this issue Mar 28, 2025 · 1 comment
Assignees
Labels
content:edit Request for content edits documentation Documentation edits product:queues Cloudflare Queues: https://developers.cloudflare.com/queues

Comments

@sev3e3e
Copy link

sev3e3e commented Mar 28, 2025

Existing documentation URL(s)

https://developers.cloudflare.com/queues/configuration/local-development/

What changes are you suggesting?

What changes are you suggesting?

The documentation currently states:

Wrangler does not yet support running separate producer and consumer Workers bound to the same Queue locally. To develop locally with Queues, you can temporarily put your consumer's queue() handler in the same Worker as your producer, so the same Worker acts as both a producer and consumer.

However, this may give the impression that separate Workers cannot be used locally at all. In practice, it is possible to run both producer and consumer Workers locally by specifying multiple configuration files when using wrangler dev. That said, since this relies on an experimental feature, I understand if it's not a good fit for the official docs — feel free to include or disregard as you see fit.

If the section were to be rewritten, it might look like this:


While Wrangler does not officially support running separate producer and consumer Workers bound to the same Queue locally, this setup can still be achieved by specifying multiple configuration files when using wrangler dev.

Note: Multiple configuration files are currently supported as an experimental feature.

For example, given the following directory structure:

project/
├── producer/
│   └── wrangler.jsonc
└── consumer/
    └── wrangler.jsonc

From within the producer/ directory, the following command starts both Workers in a single wrangler dev session, allowing you to test Queue behavior without merging logic:

wrangler dev -c ./wrangler.jsonc -c ../consumer/wrangler.jsonc --persist-to .wrangler/state

This clarification would help developers understand that local testing with separate Workers is possible, and avoid unnecessary merging of logic during development.

Why should the docs be changed?

The current documentation may give the false impression that local development with separate producer and consumer Workers is entirely unsupported. In practice, the method above provides a working solution, which can be useful for testing queue behavior without modifying deployment structure.

Without this clarification, developers may assume they have no choice but to merge producer and consumer logic into a single Worker for local testing — even if their production setup keeps them separate. While the workaround described above relies on an experimental feature, it can still help avoid unnecessary restructuring during development.

What is the expected outcome?

By updating the documentation to mention this workaround, developers can:

  • Avoid the unnecessary effort of merging producer and consumer logic into a single Worker just for local testing.
  • Test production-like architectures locally without deviation from production code.

Additional information

As discussed in this GitHub discussion, this approach is considered a workaround, and the ability to run multiple Workers in a single instance of wrangler dev may be an experimental feature.(Reference comment)

I wasn’t able to find any official documentation that clearly states when this behavior was introduced or whether it’s officially supported.

@sev3e3e sev3e3e added content:edit Request for content edits documentation Documentation edits labels Mar 28, 2025
@github-actions github-actions bot added the product:queues Cloudflare Queues: https://developers.cloudflare.com/queues label Mar 28, 2025
@harshil1712
Copy link
Contributor

Hey @sev3e3e,
Thanks for the feedback. We have updated the docs and added your suggestion. Closing this issue now.
Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content:edit Request for content edits documentation Documentation edits product:queues Cloudflare Queues: https://developers.cloudflare.com/queues
Projects
None yet
Development

No branches or pull requests

4 participants