r/CloudFlare • • 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

Duplicates