Hi Calvin On Fri, Feb 23, 2024 at 9:23 AM Calvin Liu <ca...@confluent.io.invalid> wrote: > As we agreed to implement the pagination for the new API > DescribeTopicPartitions, the client side must also add a proper interface > to handle the pagination. > The current KafkaAdminClient.describeTopics returns > the DescribeTopicsResult which is the future for querying all the topics. > It is awkward to fit the pagination into it because
I suggest taking a look at Java's Flow API: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/Flow.html It was design for this specific use case and many libraries integrate with it. If the Kafka client cannot be upgraded to support the Java 9 which introduced that API, you can copy the same interface and semantics. This would allow users to easily integrate with reactive libraries since they all integrate with Java Flow. Thanks, -- -José