Local Development
Queues support local development workflows using Wrangler, the command-line interface for Workers. Wrangler runs the same version of Queues as Cloudflare runs globally.
To develop locally with Queues, you will need:
-
Wrangler v3.1.0 ↗ or later.
-
Node.js version of
18.0.0
or later. Consider using a Node version manager like Volta ↗ or nvm ↗ to avoid permission issues and change Node versions. -
If you are new to Queues and/or Cloudflare Workers, refer to the Queues tutorial to install
wrangler
and deploy their first Queue.
Open your terminal and run the following commands to start a local development session:
Start a local dev session
Local development sessions create a standalone, local-only environment that mirrors the production environment Queues runs in so you can test your Workers before you deploy to production.
Refer to the wrangler dev
documentation to learn more about how to configure a local development session.
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.
Wrangler also does not yet support wrangler dev --remote
.