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

ConsoleConsumer crashes with new consumer when using keys because of incorrect deserializer

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0.0
    • Component/s: tools
    • Labels:
      None

      Description

      The ConsoleConsumer class uses Array[Byte] everywhere, but the new consumer is configured with a string key deserializer, resulting in a class cast exception:

      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)

      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).

        Attachments

          Activity

            People

            • Assignee:
              ewencp Ewen Cheslack-Postava
              Reporter:
              ewencp Ewen Cheslack-Postava
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: