ShivsundarR commented on code in PR #19417:
URL: https://github.com/apache/kafka/pull/19417#discussion_r2044482963


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaShareConsumer.java:
##########
@@ -140,9 +129,17 @@
  *     thrown by a failure to commit the acknowledgements.</li>
  *     <li>The application calls {@link #close()}  which releases any acquired 
records without acknowledgement.</li>
  * </ul>
- * <p>The consumer can optionally use the {@code 
internal.share.acknowledgement.mode} configuration property to choose
- * between implicit and explicit acknowledgement, specifying 
<code>"implicit"</code> or <code>"explicit"</code> as required.
- * <p>
+ * <p>If the config is set to "explicit", the consumer is using <em>explicit 
acknowledgement</em>. In this case:
+ * <ul>
+ *     <li>The application must acknowledge all the records it received in the 
batch before the next call to {@link #poll(Duration)}</li>
+ *     <li>The application calls {@link #commitSync()} or {@link 
#commitAsync()} which commits the acknowledgements to Kafka.
+ *     If any records in the batch were not acknowledged until the next 
poll(), an {@link IllegalStateException} is thrown.</li>
+ *     <li>The application calls {@link #poll(Duration)} without committing 
first, which commits the acknowledgements to
+ *     Kafka asynchronously. In this case, no exception is thrown by a failure 
to commit the acknowledgement.
+ *     If any records in the batch were not acknowledged, an {@link 
IllegalStateException} is thrown.</li>
+ *     <li>The application calls {@link #close()} which attempts to commit any 
pending acknowledgements and
+ *     releases any remaining acquired records.</li>
+ * </ul>

Review Comment:
   Thanks, this looks great. I have updated this in the PR.



-- 
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

Reply via email to