You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "John Tylwalk (JIRA)" <ji...@apache.org> on 2016/04/26 23:23:12 UTC
[jira] [Resolved] (KAFKA-3624) NullPointerException Thrown for
MetadataRequest when Cluster Not Available
[ https://issues.apache.org/jira/browse/KAFKA-3624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Tylwalk resolved KAFKA-3624.
---------------------------------
Resolution: Duplicate
> NullPointerException Thrown for MetadataRequest when Cluster Not Available
> --------------------------------------------------------------------------
>
> Key: KAFKA-3624
> URL: https://issues.apache.org/jira/browse/KAFKA-3624
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 0.9.0.0
> Reporter: John Tylwalk
>
> Have been seeing consistently a NPE when metadata request is sent against a cluster that isn't online:
> {code}
> java.lang.NullPointerException: null
> at org.apache.kafka.common.requests.MetadataResponse.<init>(MetadataResponse.java:130) ~[kafka-client-lib.jar:na]
> at org.apache.kafka.clients.consumer.internals.Fetcher.getTopicMetadata(Fetcher.java:203) ~[kafka-client-lib.jar:na]
> at org.apache.kafka.clients.consumer.KafkaConsumer.partitionsFor(KafkaConsumer.java:1143) ~[kafka-client-lib.jar:na]
> {code}
> Looks like this is from this line:
> {code}
> Object[] brokerStructs = (Object[]) struct.get(BROKERS_KEY_NAME);
> {code}
> The returned struct doesn't have the brokers key, since the returned data is incomplete, due to an invalid request. Would expect to see a better exception / handling rather than NPE.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)