frankvicky commented on code in PR #23109:
URL: https://github.com/apache/kafka/pull/23109#discussion_r4360558262
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ClassicKafkaConsumer.java:
##########
@@ -566,7 +566,7 @@ public void subscribe(SubscriptionPattern pattern) {
* the max metadata age, the consumer will refresh metadata more often and
check for matching topics.
* <p>
* See {@link #subscribe(Collection, ConsumerRebalanceListener)} for
details on the
- * use of the {@link ConsumerRebalanceListener}. Generally rebalances are
triggered when there
+ * use of the {@link RebalanceListener}. Generally rebalances are
triggered when there
Review Comment:
nit: this sentence now points readers at `subscribe(Collection,
ConsumerRebalanceListener)` (the legacy overload, soon to be deprecated) to
learn about the new `RebalanceListener`. Since this is the javadoc of the
internal helper, maybe simply:
```suggestion
* use of rebalance callbacks. Generally rebalances are triggered when
there
```
and on the line above link to `{@link RebalanceListener}` (or `{@link
#setRebalanceListener(RebalanceListener)}`) instead of the subscribe overload.
The `@link`s at the top of this javadoc that mention `#subscribe(Pattern,
ConsumerRebalanceListener)` are fine as-is, since that overload really is the
caller of this helper.
##########
clients/src/main/java/org/apache/kafka/clients/consumer/StickyAssignor.java:
##########
@@ -145,15 +145,15 @@
* clarifies this point:
* <pre>
* {@code
- * class TheNewRebalanceListener implements ConsumerRebalanceListener {
+ * class TheNewRebalanceListener implements RebalanceListener {
* Collection<TopicPartition> lastAssignment = Collections.emptyList();
*
- * void onPartitionsRevoked(Collection<TopicPartition> partitions) {
+ * void onPartitionsRevoked(Collection<TopicPartition> partitions,
RebalanceConsumer consumer) {
* for (TopicPartition partition: partitions)
* commitOffsets(partition);
Review Comment:
nit: now that the example receives a `RebalanceConsumer consumer`, it could
commit through it directly instead of the opaque `commitOffsets(partition)`
helper, e.g. `consumer.commitSync(...)`.
That would show the point of the new API. Same applies to
`TheOldRebalanceListener` above.
--
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]