mirror of https://github.com/apache/kafka.git
KAFKA-17926 Improve the documentation explaining why max.in.flight.requests.per.connection should not exceed 5 (#17719)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
2e2b0a58ed
commit
02b2fa0e3c
|
@ -255,6 +255,7 @@ public class ProducerConfig extends AbstractConfig {
|
||||||
public static final String METRIC_REPORTER_CLASSES_CONFIG = CommonClientConfigs.METRIC_REPORTER_CLASSES_CONFIG;
|
public static final String METRIC_REPORTER_CLASSES_CONFIG = CommonClientConfigs.METRIC_REPORTER_CLASSES_CONFIG;
|
||||||
|
|
||||||
// max.in.flight.requests.per.connection should be less than or equal to 5 when idempotence producer enabled to ensure message ordering
|
// max.in.flight.requests.per.connection should be less than or equal to 5 when idempotence producer enabled to ensure message ordering
|
||||||
|
// The value 5 is aligned with ProducerStateEntry#NUM_BATCHES_TO_RETAIN.
|
||||||
private static final int MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION_FOR_IDEMPOTENCE = 5;
|
private static final int MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION_FOR_IDEMPOTENCE = 5;
|
||||||
|
|
||||||
/** <code>max.in.flight.requests.per.connection</code> */
|
/** <code>max.in.flight.requests.per.connection</code> */
|
||||||
|
@ -263,8 +264,8 @@ public class ProducerConfig extends AbstractConfig {
|
||||||
+ " Note that if this configuration is set to be greater than 1 and <code>enable.idempotence</code> is set to false, there is a risk of"
|
+ " Note that if this configuration is set to be greater than 1 and <code>enable.idempotence</code> is set to false, there is a risk of"
|
||||||
+ " message reordering after a failed send due to retries (i.e., if retries are enabled); "
|
+ " message reordering after a failed send due to retries (i.e., if retries are enabled); "
|
||||||
+ " if retries are disabled or if <code>enable.idempotence</code> is set to true, ordering will be preserved."
|
+ " if retries are disabled or if <code>enable.idempotence</code> is set to true, ordering will be preserved."
|
||||||
+ " Additionally, enabling idempotence requires the value of this configuration to be less than or equal to " + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION_FOR_IDEMPOTENCE + "."
|
+ " Additionally, enabling idempotence requires the value of this configuration to be less than or equal to " + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION_FOR_IDEMPOTENCE + ","
|
||||||
+ " If conflicting configurations are set and idempotence is not explicitly enabled, idempotence is disabled. ";
|
+ " because broker only retains at most 5 batches for each producer. If the value is more than 5, previous batches may be removed on broker side.";
|
||||||
|
|
||||||
/** <code>retries</code> */
|
/** <code>retries</code> */
|
||||||
public static final String RETRIES_CONFIG = CommonClientConfigs.RETRIES_CONFIG;
|
public static final String RETRIES_CONFIG = CommonClientConfigs.RETRIES_CONFIG;
|
||||||
|
|
Loading…
Reference in New Issue