You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/queues/configuration/local-development.mdx
+10-20Lines changed: 10 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,38 +50,26 @@ Local development sessions create a standalone, local-only environment that mirr
50
50
Refer to the [`wrangler dev` documentation](/workers/wrangler/commands/#dev) to learn more about how to configure a local development session.
51
51
52
52
## Separating producer & consumer Workers
53
-
54
-
If you want to run separate producer and consumer Workers bound to the same Queue locally, you can use the [experimental feature](/workers/runtime-apis/bindings/service-bindings/#local-development) of Wrangler.
53
+
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.
55
54
56
55
:::caution
57
-
58
56
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)
59
-
60
57
:::
61
58
62
-
For a project with the following structure,
63
-
59
+
For example, if your project is setup with the following directory structure:
64
60
```
65
-
project-root/
66
-
├── consumer-worker/
67
-
│ ├── wrangler.jsonc
68
-
│ └── index.ts
69
-
└── producer-worker/
61
+
producer-worker/
62
+
├── wrangler.jsonc
63
+
├── index.ts
64
+
└── consumer-worker/
70
65
├── wrangler.jsonc
71
66
└── index.ts
72
67
```
73
68
74
-
you can start the development server with the following command:
75
-
69
+
You can start the development server for both workers with the following command:
76
70
```sh
77
-
# navigate to the producer Worker directory
78
-
# cd producer-worker
79
-
# From the producer Worker directory
80
-
npx wrangler dev -c ./wrangler.jsonc -c ../consumer-worker/wrangler.jsonc --persist-to .wrangler/state
71
+
npx wrangler dev -c wrangler.jsonc -c consumer-worker/wrangler.jsonc --persist-to .wrangler/state
81
72
```
82
-
83
-
The development server will start and you will see output similar to the following:
84
-
85
73
```sh output
86
74
⛅️ wrangler 4.13.2
87
75
-------------------
@@ -96,6 +84,8 @@ No bindings found.
96
84
[wrangler:inf] Ready on http://localhost:8787
97
85
```
98
86
87
+
When the producer Worker sends messages to the queue, the consumer Worker will automatically be invoked to handle them.
88
+
99
89
## Known Issues
100
90
101
91
- When developing locally, you can not connect your Worker to the remote queue. Hence, Queues does not yet support `wrangler dev --remote`.
0 commit comments