[
https://issues.apache.org/jira/browse/KAFKA-20119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18057452#comment-18057452
]
Chia-Ping Tsai commented on KAFKA-20119:
----------------------------------------
Ugh, I just noticed that `assign` only triggers an auto-commit if the commit
timer has expired. This means the docs statement, "if auto-commit is enabled,
an async commit... will be triggered", is actually incorrect
https://github.com/apache/kafka/blob/0166a0342d82b3b9b89397b15304e974507c7eb8/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java#L1201
> Clarify that `Consumer#unsubscribe` does not trigger auto-commit
> ----------------------------------------------------------------
>
> Key: KAFKA-20119
> URL: https://issues.apache.org/jira/browse/KAFKA-20119
> Project: Kafka
> Issue Type: Improvement
> Components: clients, consumer, docs
> Reporter: Chia-Ping Tsai
> Assignee: TaiJuWu
> Priority: Minor
>
> I suggest adding a note to clarify that unsubscribe() does not guarantee a
> commit, which could lead to duplicate processing if offsets are not manually
> committed.
> {code:java}
> Note: Unlike close(), this method does not guarantee that pending offsets are
> committed before unsubscribing, even if enable.auto.commit is enabled. To
> avoid duplicate processing upon re-joining, it is recommended to explicitly
> call {@link #commitSync()} before invoking this method
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)