Replies: 2 comments
|
The 1. Separate
|
|
What has worked best for me in this situation is running the producer and consumer as separate For example: # terminal 1: HTTP producer
wrangler dev --config ./primary/wrangler.toml \
--port 8787 --inspector-port 9229 \
--persist-to ./.wrangler/state
# terminal 2: queue consumer
wrangler dev --config ./consumer/wrangler.toml \
--port 8788 --inspector-port 9230 \
--persist-to ./.wrangler/stateAnd make sure the queue name matches on both sides: [[queues.producers]]
queue = "jobs"
binding = "JOBS"
[[queues.consumers]]
queue = "jobs"
max_batch_size = 1Two easy ways this breaks locally:
So yes: I think the path is “multiple |
Uh oh!
There was an error while loading. Please reload this page.
We have an application with several workers. The primary worker receives HTTP requests and puts data into the queue. The secondary worker consumes messages from the queue and performs the actual job.
If we run all workers with the single
wrangler devcommand with multiple config flags, everything works as expected, but the Node debugger can listen only to the primary worker. And it makes debugging almost useless because the internal worker does the actual work.It's possible to run workers separately. Binging services are connected, but it looks like the queue is not. Messages are not consumed.
I found the https://developers.cloudflare.com/workers/vite-plugin/reference/debugging/ documentation, but I didn't try it because we have a pure backend application, and Vite seems like overkill.
What is the way to debug secondary workers?
All reactions