Description
The Fetcher class will throw a NullPointerException if a broker cannot be reached:
Exception in thread "main" java.lang.NullPointerException
at org.apache.kafka.common.requests.MetadataResponse.<init>(MetadataResponse.java:130)
at org.apache.kafka.clients.consumer.internals.Fetcher.getTopicMetadata(Fetcher.java:203)
at org.apache.kafka.clients.consumer.KafkaConsumer.partitionsFor(KafkaConsumer.java:1143)
at org.apache.kafka.connect.util.KafkaBasedLog.start(KafkaBasedLog.java:126)
at org.apache.kafka.connect.storage.KafkaOffsetBackingStore.start(KafkaOffsetBackingStore.java:85)
at org.apache.kafka.connect.runtime.Worker.start(Worker.java:108)
at org.apache.kafka.connect.runtime.Connect.start(Connect.java:56)
at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:62)
This is trivially reproduced by trying to start Kafka Connect in distributed mode (i.e. connect-distributed.sh config/connect-distributed.properties) with no broker running. However, it's not specific to Kafka Connect, it just happens to use the consumer in a way that triggers it reliably.
Attachments
Issue Links
- is duplicated by
-
KAFKA-3041 NullPointerException in new Consumer API on broker restart
- Resolved