Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-2880

Fetcher.getTopicMetadata NullPointerException when broker cannot be reached

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.9.0.0
    • 0.9.0.1
    • clients
    • None

    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

          Activity

            People

              hachikuji Jason Gustafson
              ewencp Ewen Cheslack-Postava
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: