Skip to content

Commit 610468e

Browse files
[Queues] Update local development known issues (#21977)
* add instruction for running separate queue workers * minor updates * Update local-development.mdx * Update local-development.mdx * Update local-development.mdx * Update local-development.mdx * Update local-development.mdx * Update local-development.mdx --------- Co-authored-by: Pranshu Maheshwari <[email protected]>
1 parent 9a35e41 commit 610468e

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

src/content/docs/queues/configuration/local-development.mdx

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,48 @@ To develop locally with Queues, you will need:
2020
## Start a local development session
2121

2222
Open your terminal and run the following commands to start a local development session:
23-
2423
```sh
25-
# Confirm we are using wrangler v3.1.0+
26-
wrangler --version
27-
```
28-
29-
```sh output
30-
⛅️ wrangler 3.1.0
31-
```
32-
33-
Start a local dev session
34-
35-
```sh
36-
# Start a local dev session:
37-
npx wrangler dev
24+
npx wrangler@latest dev
3825
```
3926

4027
```sh output
4128
------------------
42-
wrangler dev now uses local mode by default, powered by 🔥 Miniflare and 👷 workerd.
43-
To run an edge preview session for your Worker, use wrangler dev --remote
44-
⎔ Starting local server...
45-
[mf:inf] Ready on http://127.0.0.1:8787/
29+
Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudflare.com/workers/testing/local-development.
30+
31+
Your worker has access to the following bindings:
32+
- Queues: <QUEUE-NAME>
4633
```
4734

4835
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.
4936

5037
Refer to the [`wrangler dev` documentation](/workers/wrangler/commands/#dev) to learn more about how to configure a local development session.
5138

52-
## Known Issues
39+
## Separating producer & consumer Workers
40+
Wrangler supports running multiple Workers simultaneously with a single command. If your architecture separates the producer and consumer into distinct Workers, you can use this functionality to test the entire message flow locally.
5341

54-
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.
42+
:::caution
43+
Support for running multiple Workers at once with one Wrangler command is experimental, and subject to change as we work on the experience. If you run into bugs or have any feedback, [open an issue on the workers-sdk repository](https://github.com/cloudflare/workers-sdk/issues/new)
44+
:::
5545

56-
Wrangler also does not yet support `wrangler dev --remote`.
46+
For example, if your project has the following directory structure:
47+
```
48+
producer-worker/
49+
├── wrangler.jsonc
50+
├── index.ts
51+
└── consumer-worker/
52+
├── wrangler.jsonc
53+
└── index.ts
54+
```
55+
56+
You can start development servers for both workers with the following command:
57+
```sh
58+
npx wrangler@latest dev -c wrangler.jsonc -c consumer-worker/wrangler.jsonc --persist-to .wrangler/state
59+
```
60+
61+
When the producer Worker sends messages to the queue, the consumer Worker will automatically be invoked to handle them.
62+
:::note
63+
[Consumer concurrency](/queues/configuration/consumer-concurrency/) is not supported while running locally.
64+
:::
65+
66+
## Known Issues
67+
- Queues does not support Wrangler remote mode (`wrangler dev --remote`).

0 commit comments

Comments
 (0)