Specifying Queues per environment in wrangler.toml file

I’m trying to specify separate queue settings in my wrangler.toml file for a specific environment but cannot. Here’s what I have (not functional)

name = "server-side-worker"
main = "src/index.js"
compatibility_date = "2023-05-16"

[[queues.producers]]
    queue = "prod_queue"
    binding = "THE_Q"

[[queues.consumers]]
  queue = "prod_queue"

[env.test]
name = "server-side-worker-test"

[[queues.producers]]
    queue = "prod_queue"
    binding = "THE_Q"

[[queues.consumers]]
  queue = "prod_queue"

Each time I try to deploy, I receive the error:

▲ [WARNING] Processing wrangler.toml configuration:

  
    - "env.test" environment configuration
      - "queues" exists at the top level, but not on "env.test".
        This is not what you probably want, since "queues" is not inherited by environments.
        Please add "queues" to "env.test".

1 Like

You can try:

[[env.production.queues.producers]]
4 Likes

That’s it! Thanks, @elliot5! Probably the one thing I didn’t try! :slight_smile:

Yeah figured it out from converting TOML → JSON → TOML :smiley:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.