showuon commented on a change in pull request #11467: URL: https://github.com/apache/kafka/pull/11467#discussion_r742808430
########## File path: clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java ########## @@ -100,8 +100,6 @@ * {@code * Properties props = new Properties(); * props.put("bootstrap.servers", "localhost:9092"); - * props.put("acks", "all"); - * props.put("retries", 0); Review comment: In V3.0, `acks` is default to `all` already. And `enable.idempotence` is set to true in V3.0, which means `retires` can not set to 0 now. ########## File path: clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java ########## @@ -117,14 +115,15 @@ * as well as a background I/O thread that is responsible for turning these records into requests and transmitting them * to the cluster. Failure to close the producer after use will leak these resources. * <p> - * The {@link #send(ProducerRecord) send()} method is asynchronous. When called it adds the record to a buffer of pending record sends + * The {@link #send(ProducerRecord) send()} method is asynchronous. When called, it adds the record to a buffer of pending sending record * and immediately returns. This allows the producer to batch together individual records for efficiency. * <p> * The <code>acks</code> config controls the criteria under which requests are considered complete. The "all" setting * we have specified will result in blocking on the full commit of the record, the slowest but most durable setting. * <p> - * If the request fails, the producer can automatically retry, though since we have specified <code>retries</code> - * as 0 it won't. Enabling retries also opens up the possibility of duplicates (see the documentation on + * If the request fails, the producer can automatically retry. We have specified <code>retries</code> default as Integer.MAX_VALUE. + * It's recommended to use <code>delivery.timeout.ms</code> to control retry behavior, instead of <code>retries</code>. + * Enabling retries also opens up the possibility of duplicates (see the documentation on Review comment: After [KIP-91](https://cwiki.apache.org/confluence/display/KAFKA/KIP-91+Provide+Intuitive+User+Timeouts+in+The+Producer), we set `retries` as max value, and it's recommended to use `delivery.timeout.ms` to control retry behavior. Update it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org