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
+41-1Lines changed: 41 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,13 +49,53 @@ Local development sessions create a standalone, local-only environment that mirr
49
49
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
-
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. To develop locally with separate producer and consumer Workers, you can start the development server with the following command:
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.
55
+
56
+
:::caution
57
+
58
+
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
+
:::
61
+
62
+
For a project with the following structure,
63
+
64
+
```
65
+
project-root/
66
+
├── consumer-worker/
67
+
│ ├── wrangler.jsonc
68
+
│ └── index.ts
69
+
└── producer-worker/
70
+
├── wrangler.jsonc
71
+
└── index.ts
72
+
```
73
+
74
+
you can start the development server with the following command:
53
75
54
76
```sh
77
+
# navigate to the producer Worker directory
78
+
# cd producer-worker
55
79
# From the producer Worker directory
56
80
npx wrangler dev -c ./wrangler.jsonc -c ../consumer-worker/wrangler.jsonc --persist-to .wrangler/state
57
81
```
58
82
83
+
The development server will start and you will see output similar to the following:
84
+
85
+
```sh output
86
+
⛅️ wrangler 4.13.2
87
+
-------------------
88
+
89
+
Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudflare.com/workers/testing/local-development.
90
+
91
+
docs-queue-producer has access to the following bindings:
92
+
- Queues:
93
+
- MY_QUEUE: <queue_name> [simulated locally]
94
+
No bindings found.
95
+
⎔ Starting local server...
96
+
[wrangler:inf] Ready on http://localhost:8787
97
+
```
98
+
59
99
## Known Issues
60
100
61
101
- 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