[ https://issues.apache.org/jira/browse/KAFKA-2793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997993#comment-14997993 ]
ASF GitHub Bot commented on KAFKA-2793: --------------------------------------- GitHub user ewencp opened a pull request: https://github.com/apache/kafka/pull/482 KAFKA-2793: Use ByteArrayDeserializer instead of StringDeserializer for keys in ConsoleConsumer with new consumer. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ewencp/kafka kafka-2793-console-consumer-new-consumer-deserializer Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/482.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #482 ---- commit b437ffa341ff9e1c8e39b74d64ba9a51785172bc Author: Ewen Cheslack-Postava <m...@ewencp.org> Date: 2015-11-10T05:44:00Z KAFKA-2793: Use ByteArrayDeserializer instead of StringDeserializer for keys in ConsoleConsumer with new consumer. ---- > ConsoleConsumer crashes with new consumer when using keys because of > incorrect deserializer > ------------------------------------------------------------------------------------------- > > Key: KAFKA-2793 > URL: https://issues.apache.org/jira/browse/KAFKA-2793 > Project: Kafka > Issue Type: Bug > Components: tools > Reporter: Ewen Cheslack-Postava > Assignee: Ewen Cheslack-Postava > > The ConsoleConsumer class uses Array[Byte] everywhere, but the new consumer > is configured with a string key deserializer, resulting in a class cast > exception: > {quote} > java.lang.ClassCastException: java.lang.String cannot be cast to [B > at kafka.consumer.NewShinyConsumer.receive(BaseConsumer.scala:62) > at kafka.tools.ConsoleConsumer$.process(ConsoleConsumer.scala:101) > at kafka.tools.ConsoleConsumer$.run(ConsoleConsumer.scala:64) > at kafka.tools.ConsoleConsumer$.main(ConsoleConsumer.scala:42) > at kafka.tools.ConsoleConsumer.main(ConsoleConsumer.scala) > {quote} > Note that this is an issue whether you are printing the keys or not, it will > be triggered by any non-null key (and I'd imagine some should also trigger > serialization exceptions if they are not UTF8-decodeable). -- This message was sent by Atlassian JIRA (v6.3.4#6332)