You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Ismael Juma (JIRA)" <ji...@apache.org> on 2017/06/10 01:27:19 UTC

[jira] [Commented] (KAFKA-5424) KafkaConsumer.listTopics() throws Exception when unauthorized topics exist in cluster

    [ https://issues.apache.org/jira/browse/KAFKA-5424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16045301#comment-16045301 ] 

Ismael Juma commented on KAFKA-5424:
------------------------------------

Thanks for the report. Can you specify the version where you've seen this? The broker doesn't return topics that the user has no authorization for so the method should work fine as it is. Some older versions of the broker did not behave like this though.

> KafkaConsumer.listTopics() throws Exception when unauthorized topics exist in cluster
> -------------------------------------------------------------------------------------
>
>                 Key: KAFKA-5424
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5424
>             Project: Kafka
>          Issue Type: Bug
>          Components: consumer
>            Reporter: Mike Fagan
>
> KafkaConsumer.listTopics() internally calls Fetcher. getAllTopicMetadata(timeout) and this method will throw a TopicAuthorizationException when there exists an unauthorized topic in the cluster. 
> This behavior runs counter to the API docs and makes listTopics() unusable except in the case of the consumer is authorized for every single topic in the cluster. 
> A potentially better approach is to have Fetcher implement a new method getAuthorizedTopicMetadata(timeout)  and have KafkaConsumer call this method instead of getAllTopicMetadata(timeout) from within KafkaConsumer.listTopics()



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)