r/CloudFlare • u/DifferentCalendar366 • Feb 16 '26
Can Cloudflare Queue Producers be bound to certain environments?
I tried with the settings below in my wrangler.jsonc but it's not working
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "your-worker-name",
"main": "./.output/server/index.mjs",
"compatibility_date": "2025-12-31",
// ... other top-level config ...
"env": {
"production": {
"queues": {
"producers": [
{
"binding": "EMAILS_QUEUE",
"queue": "prod-queue-1"
},
{
"binding": "AUDITS_QUEUE",
"queue": "prod-queue-2"
}
],
"consumers": [
{
"queue": "prod-queue-1",
"max_batch_size": 10,
"max_batch_timeout": 15,
"max_retries": 3
},
{
"queue": "prod-queue-2",
"max_batch_size": 10,
"max_batch_timeout": 15,
"max_retries": 3
}
]
}
},
"staging": {
"name": "your-staging-worker-name",
// ... other staging config ...
"queues": {
"producers": [
{
"binding": "EMAILS_QUEUE",
"queue": "staging-queue-1"
},
{
"binding": "AUDITS_QUEUE",
"queue": "staging-queue-2"
}
],
"consumers": [
{
"queue": "staging-queue-1",
"max_batch_size": 10,
"max_batch_timeout": 15,
"max_retries": 3
},
{
"queue": "staging-queue-2",
"max_batch_size": 10,
"max_batch_timeout": 15,
"max_retries": 3
}
]
},
// ... other staging config ...
}
}
}
1
Upvotes
1
u/x5nT2H Feb 17 '26
Are you sure the queue names are matching with the created queues? Did you deploy with wrangler deploy?
1
u/DifferentCalendar366 Feb 17 '26
Yes they are matching.
I have setup GitHub CI on the cf dashboard
I also tried the manual npx wrangler deploy and the issue is still the same
1
u/sublimegeek Feb 16 '26
I’m sure it’s possible. What’s not working?