Skip to content
Kafka Is FunProgress

IntermediateInternals

What is the significance of max.in.flight.requests.per.connection in relation to ordering?

Reference answer

max.in.flight.requests.per.connection allows multiple in-flight ProduceRequests to a broker simultaneously for throughput. With retries enabled and this > 1 (non-idempotent), retry of request N could complete after request N+1 succeeded, causing out-of-order delivery within a partition. Solution: if ordering matters AND retries > 0, either set max.in.flight.requests.per.connection=1 (throughput hit) OR use enable.idempotence=true which safely allows up to 5 in-flight requests while preserving order via sequence numbers.

Expected key concepts: max.in.flight.requests, ordering, retries, out-of-order, enable.idempotence, sequence numbers, throughput, partition