lianetm commented on code in PR #19595:
URL: https://github.com/apache/kafka/pull/19595#discussion_r2068951006
##########
clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java:
##########
@@ -274,11 +274,12 @@ public class ProducerConfig extends AbstractConfig {
/** <code>retries</code> */
public static final String RETRIES_CONFIG =
CommonClientConfigs.RETRIES_CONFIG;
- private static final String RETRIES_DOC = "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."
- + " Produce requests will be failed before the number of retries
has been exhausted if the timeout configured by"
- + " <code>" + DELIVERY_TIMEOUT_MS_CONFIG + "</code> expires first
before successful acknowledgement. Users should generally"
- + " prefer to leave this config unset and instead use <code>" +
DELIVERY_TIMEOUT_MS_CONFIG + "</code> to control"
+ private static final String RETRIES_DOC = "Number of times to retry a
request that fails with a transient error."
+ + " Setting a value greater than zero will cause the client to
resend any record whose send fails with a potentially transient error. "
+ + " Requests will be retried this many times until they succeed,
fail with a non-transient error, or the <code> DELIVERY_TIMEOUT_MS_CONFIG
</code> expires."
+ + " Note that this automatic retry is no different than if the
client resent the record upon receiving the error."
+ + " Setting a value of zero will disable this automatic retry
behaviour, so that the transient errors will be propagated to the application
to be handled."
+ + " Users should generally prefer to leave this config unset and
instead use <code>" + DELIVERY_TIMEOUT_MS_CONFIG + "</code> to control"
+ " retry behavior."
+ "<p>"
+ "Enabling idempotence requires this config value to be greater
than 0."
Review Comment:
well the trick is that there is a diff between user enabling idemp
explicitly (then it does "require this config value to be greater than 0.",
will throw otherwise), vs. user not setting the prop, in which case idemp is
enabled by default as you said, but it does not required the retries >0 (If
retries=zero it won't fail, it simply disables idempotence automatically and
the retries=0 is respected). Makes sense?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]