This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • KIP-45 - Standardize all client sequence interaction on j.u.Collection.

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


No new public interfaces are introduced, but changes to the existing ones are introduced:


Code Block
void subscribe(Collection<String> topics);
void subscribe(Collection<String> topics, ConsumerRebalanceListener);
void assign(Collection<TopicPartition> partitions);
void pause(Collection<TopicPartition> partitions);
void resume(Collection<TopicPartition> partitions);
void seekToBeginning(Collection<TopicPartition>);
void seekToEnd(Collection<TopicPartition>);


Code Block
void subscribe(java.util.List<java.lang.String> topics);
void subscribe(java.util.List<java.lang.String> topics, ConsumerRebalanceListener listener);
void assign(java.util.List<TopicPartition> partitions);
void pause(TopicPartition... partitions);
void resume(TopicPartition... partitions);
void seekToBeginning(TopicPartition... partitions);
void seekToEnd(TopicPartition... partitions);




Proposed Changes

The proposed change boils down to the public interface changes above.  If the first patch KAFKA-3006 is accepted, a standardization of signatures in Kafka Connect should also be considered.


  • Code that used the previous array based signatures will have to be adapted.
  • JVMs that depend on both the client and later versions would have incompatible signatures.
  • These drawbacks are mitigated by the fact that KafkaConsumer is annotated with @InterfaceStability.Unstable.
  • java.util.Collection was chosen because it is a super-type of java.util.Set and java.util.List which are used as return types for partitionsFor and assignment.
  • java.util.Collection as the nice added benefit of providing simple interaction with other JVM languages.

Rejected Alternatives

An alternative would be to keep the array-based versions of the calls and mark them as deprecated but this has not gathered much interest. This KIP also supersedes some of the propositions outlined in KAFKA-2991