[ https://issues.apache.org/jira/browse/KAFKA-5848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16156375#comment-16156375 ]
huxihx commented on KAFKA-5848: ------------------------------- [~mjsax] Seems the metadata does not get loaded when invoking `assign`, so it's not easy to check whether the given partition number is less than the total partition count. > KafkaConsumer should validate topics/TopicPartitions on subscribe/assign > ------------------------------------------------------------------------ > > Key: KAFKA-5848 > URL: https://issues.apache.org/jira/browse/KAFKA-5848 > Project: Kafka > Issue Type: Bug > Components: clients > Affects Versions: 0.11.0.0 > Reporter: Matthias J. Sax > Priority: Minor > > Currently, {{KafkaConsumer}} checks if the provided topics on {{subscribe()}} > and {{TopicPartition}} on {{assign()}} don't contain topic names that are > {{null}} or an empty string. > However, it could do some more validation: > - check if invalid topic characters are in the string (this might be > feasible for {Patterns}}, too?) > - check if provided partition numbers are valid (ie, not negative and maybe > not larger than the available partitions?) -- This message was sent by Atlassian JIRA (v6.4.14#64029)