Clarify that separate producer and consumer Workers for Queues can be run locally with wrangler dev #21208
Labels
content:edit
Request for content edits
documentation
Documentation edits
product:queues
Cloudflare Queues: https://developers.cloudflare.com/queues
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:
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:
From within the
producer/
directory, the following command starts both Workers in a singlewrangler dev
session, allowing you to test Queue behavior without merging logic: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:
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.
The text was updated successfully, but these errors were encountered: