A `queue()` handler accepts a message, the Env, and the context per https://developers.cloudflare.co

A queue() handler accepts a message, the Env, and the context per https://developers.cloudflare.com/queues/configuration/javascript-apis/#consumer

But what are you writing to env? Where would the middleware run? The env from the request (in your producer) is not the same as the one in the consumer. They are decoupled (as they should be)
Cloudflare Docs
Cloudflare Queues is integrated with Cloudflare Workers. To send and receive messages, you must use a Worker.
Was this page helpful?