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

NullPointerException in ConsoleConsumer

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.1
    • Component/s: consumer
    • Labels:
      None

      Description

      The protocol document [1] mentions that keys and values in message sets can be null. However the ConsoleConsumer throws a NPE when a null is passed for the value.

      java.lang.NullPointerException
      at kafka.utils.Utils$.readBytes(Utils.scala:141)
      at kafka.consumer.ConsumerIterator.makeNext(ConsumerIterator.scala:106)
      at kafka.consumer.ConsumerIterator.makeNext(ConsumerIterator.scala:33)
      at kafka.utils.IteratorTemplate.maybeComputeNext(IteratorTemplate.scala:61)
      at kafka.utils.IteratorTemplate.hasNext(IteratorTemplate.scala:53)
      at scala.collection.Iterator$class.foreach(Iterator.scala:631)
      at kafka.utils.IteratorTemplate.foreach(IteratorTemplate.scala:32)
      at scala.collection.IterableLike$class.foreach(IterableLike.scala:79)
      at kafka.consumer.KafkaStream.foreach(KafkaStream.scala:25)
      at kafka.consumer.ConsoleConsumer$.main(ConsoleConsumer.scala:195)
      at kafka.consumer.ConsoleConsumer.main(ConsoleConsumer.scala)

      [1] https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-Messagesets

        Attachments

        1. Kafka897-v1.patch
          2 kB
          Colin B.
        2. KAFKA-897-v2.patch
          1 kB
          Colin B.

          Activity

            People

            • Assignee:
              nehanarkhede Neha Narkhede
              Reporter:
              lanzaa Colin B.
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: