adikou commented on code in PR #22270:
URL: https://github.com/apache/kafka/pull/22270#discussion_r3245340562
##########
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRebalanceListener.java:
##########
@@ -89,31 +103,37 @@
* Here is pseudo-code for a callback implementation for saving offsets:
* <pre>
* {@code
- * public class SaveOffsetsOnRebalance implements ConsumerRebalanceListener {
- * private Consumer<?,?> consumer;
+ * consumer.subscribe(List.of("topic-1", "topic-2"));
+ * consumer.setConsumerRebalanceListener(new ConsumerRebalanceListener() {
+ * @Override
+ * public void onPartitionsRevoked(Collection<TopicPartition>
partitions) {}
Review Comment:
It does, but I really like that the original `ConsumerRebalanceListener`
forced users to think about both the assigned and revoked cases in tandem.
Making everything default feels like we'll make the interface very loosely
defined with opt-ins for each method.
I think amending the KIP is a good next step. But may I propose we deprecate
the non-consumer methods and make the RebalanceConsumer method the default in
5.0 with assigned and revoked abstract, lost behaves the same way. This would
cut the number of methods in half, since we're doing duplicating efforts by
supporting the simple case.
Which way do you feel strongly about?
--
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]