# org.apache.kafka.common.errors.FetchTimeoutException：分区my-topic-0的获取请求在30000毫秒后超时

- **ID:** `kafka/consumer-fetch-timeout`
- **领域:** kafka
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 75%

## 根因

由于网络拥塞、代理过载或分区领导者缓慢，消费者对代理的获取请求超过了配置的超时时间。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| kafka 3.0.0 | active | — | — |
| kafka 3.3.0 | active | — | — |
| kafka 3.5.0 | active | — | — |

## 解决方案

1. ```
   Increase the broker's 'fetch.purgatory.purge.interval.requests' and tune 'num.network.threads' to handle more concurrent fetch requests, reducing queue delays.
   ```
2. ```
   Add a retry mechanism in the consumer with exponential backoff on FetchTimeoutException, and reduce fetch.min.bytes to allow smaller, faster responses.
   ```

## 无效尝试

- **** — This only masks the timeout and can lead to increased consumer latency and backlog, without fixing the underlying network or broker issue. (40% 失败率)
- **** — Restarting re-establishes the connection but does not resolve persistent network or broker load issues; the timeout will recur. (70% 失败率)
