You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/06/10 13:33:54 UTC

[GitHub] [kafka] ijuma commented on a change in pull request #10584: KAFKA-12701: NPE in MetadataRequest when using topic IDs

ijuma commented on a change in pull request #10584:
URL: https://github.com/apache/kafka/pull/10584#discussion_r649187595



##########
File path: clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java
##########
@@ -92,6 +93,15 @@ public MetadataRequest build(short version) {
             if (!data.allowAutoTopicCreation() && version < 4)
                 throw new UnsupportedVersionException("MetadataRequest versions older than 4 don't support the " +
                         "allowAutoTopicCreation field");
+            if (version >= 10) {
+                if (data.topics() != null) {
+                    data.topics().forEach(topic -> {
+                        if (topic.name() == null || topic.topicId() != Uuid.ZERO_UUID)
+                            throw new UnsupportedVersionException("MetadataRequest version " + version  +
+                                    " does not support null topic names or topic IDs.");

Review comment:
       Slight clarification: `or non-null topic IDs`




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org