# Fix queue binding consumer not found for producer

## TL;DR

The queue name in the producer binding and the queue name in the consumer config must match exactly, and the consumer worker must export a `queue(batch, env)` handler. Producers and consumers are linked purely by that name string, so a typo orphans the producer and nothing ever runs. Fix the name, redeploy both sides, and send a test message.

## Verbatim error

```text
workerd error: queue binding consumer not found for producer
```

## Steps

1. Open the producer's wrangler.toml and note the `[[queues.producers]]` entry: its `binding` name and its `queue` name. Expected: you have the exact queue name recorded.
2. Open the consumer's wrangler.toml and note the `[[queues.consumers]]` `queue` name. Expected: comparing the two usually reveals the typo or rename.
3. Make the names identical (they are case-sensitive). Expected: both sides reference the same queue string.
4. Confirm the consumer worker exports `async queue(batch, env)`. Expected: the handler is present and exported.
5. Confirm the queue exists: `npx wrangler queues list`. Expected: the queue name appears in the list.
6. Redeploy the consumer, then send a test message from the producer. Expected: the batch arrives and the consumer's logs run.

## Use this when

- "queue binding consumer not found for producer" appears in logs
- The producer sends messages but the consumer never fires
- A queue was renamed and one side was not updated

## Not for this skill when

- Messages are consumed but the handler fails (check batch retry and DLQ settings)
- The queue was deleted (recreate it first)
- The problem is dead-letter queue routing rather than discovery

## Variant phrasings

- workers queues consumer not found
- queue() handler never called
- producer binding queue name mismatch
- cloudflare queue messages never delivered

## Why it happens

Producers and consumers are linked by nothing but the queue name string in each wrangler.toml. A typo, a rename applied to only one side, or a consumer config deployed to the wrong worker leaves the producer pointing at a queue with no consumer attached, so messages pile up and nothing runs.

## Edge cases

- A consumer on a different worker needs that worker deployed with the consumer config; deploying only the producer changes nothing.
- `max_batch_size` and `max_batch_timeout` tune delivery timing, not discovery; they will not fix a missing consumer.
- Deleting and recreating a queue with the same name is fine; the binding follows the name.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_NRv-QkaHyV7TgJCvjbaWog
