I've mentioned this before, and have had

I've mentioned this before, and have had a github issue open for some time (https://github.com/cloudflare/workers-sdk/issues/9795) but it's currently impossible to get queues working, between workers, when any workers are using Vite plugin. We are desperately awaiting a solution to this, as we cannot build on queues if we can't use them locally
6 Replies
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
James
James2mo ago
I just force my vite worker to send the queue message to a local fetch handler for the queue producer when in local dev, and use the regular queue binding in prod.
ALECKS
ALECKSOP2mo ago
Yeah, we've experimented with workarounds ( queue to a local consumer which RPCs to destination worker, which queues to another local consumer) but this is hacky and doesn't let us properly test production feature correctly, such as DLQ, batching, etc..
James
James2mo ago
you're overthinking it, you can literally put a proxy call before calling the queue binding .send() to either route the message to the real RPC method, or a fetch handler for your original queue producer. the fetch handler would then call the RPC of the real queue send(). From there all your original consumer logic remains as-is. You're literally trading off a send() method for a fetch method from the caller. DLQ, batching all acts as-is from a consumer POV.
ALECKS
ALECKSOP2mo ago
Yes, that's a cleaner workaround. My larger point still stands though... Too much of a risk for us to base such a critical part of our system on a technology that needs workarounds. This should just work and frankly, CF is dropping the ball here.
James
James2mo ago
its a workaround for local dev, pretty low risk you have a higher risk of real runtime concerns which have nothing to do with this like queue saturation

Did you find this page helpful?