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

Jay Kreps commented on KAFKA-897:
---------------------------------

Yup, I think we are confusing the protocol and the code. The protocol allows 
null values. The code didn't handle this until we added log compaction which is 
on trunk. In other words this was intentional sequencing so we wouldn't change 
the protocol again.
                
> NullPointerException in ConsoleConsumer
> ---------------------------------------
>
>                 Key: KAFKA-897
>                 URL: https://issues.apache.org/jira/browse/KAFKA-897
>             Project: Kafka
>          Issue Type: Bug
>          Components: consumer
>    Affects Versions: 0.8
>            Reporter: Colin B.
>            Assignee: Neha Narkhede
>            Priority: Minor
>         Attachments: Kafka897-v1.patch
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to