Kafka - max.in.flight.requests.per.connection 是每个生产者还是每个会话?

Kafka - max.in.flight.requests.per.connection is per producer or session?

我正在阅读文档,对参数 "max.in.flight.requests.per.connection"

有点困惑

The maximum number of unacknowledged requests the client will send on a single connection before blocking. Note that if this setting is set to be greater than 1 and there are failed sends, there is a risk of message re-ordering due to retries (i.e., if retries are enabled).

短语"unacknowledged requests"指的是每个生产者或每个连接或每个客户?

每个分区。 Kafka 在内部可能会多路复用连接(例如,使用单个连接为不同的 topics/partitions 发送多个请求,这些请求由同一代理处理),或者每个分区都有一个单独的连接,但这些都是性能问题 主要在客户内部处理。

retries 的文档提供了更多信息(并阐明了每个分区)

Setting a value greater than zero will cause the client to resend any record whose send fails with a potentially transient error. Note that this retry is no different than if the client resent the record upon receiving the error. Allowing retries without setting max.in.flight.requests.per.connection to 1 will potentially change the ordering of records because if two batches are sent to a single partition, and the first fails and is retried but the second succeeds, then the records in the second batch may appear first. Note additionally that produce requests will be failed before the number of retries has been exhausted if the timeout configured by delivery.timeout.ms expires first before successful acknowledgement. Users should generally prefer to leave this config unset and instead use delivery.timeout.ms to control retry behavior.