Ewen Cheslack-Postava created KAFKA-2793:
--------------------------------------------
Summary: 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)