You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Yeva Byzek (JIRA)" <ji...@apache.org> on 2017/05/18 17:29:10 UTC

[jira] [Updated] (KAFKA-5278) kafka-console-consumer: `--value-deserializer` is not working but `--property value.deserializer` does

     [ https://issues.apache.org/jira/browse/KAFKA-5278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yeva Byzek updated KAFKA-5278:
------------------------------
    Description: 
kafka-console-consumer: {{--value-deserializer}} is not working but {{--property value.deserializer}} is working


1. Does not work
{noformat}
$ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1  --value-deserializer org.apache.kafka.common.serialization.LongDeserializer
[2017-05-18 13:09:41,745] ERROR Error processing message, terminating consumer process:  (kafka.tools.ConsoleConsumer$)
java.lang.ClassCastException: java.lang.Long cannot be cast to [B
	at kafka.consumer.NewShinyConsumer.receive(BaseConsumer.scala:100)
	at kafka.tools.ConsoleConsumer$.process(ConsoleConsumer.scala:120)
	at kafka.tools.ConsoleConsumer$.run(ConsoleConsumer.scala:75)
	at kafka.tools.ConsoleConsumer$.main(ConsoleConsumer.scala:50)
	at kafka.tools.ConsoleConsumer.main(ConsoleConsumer.scala)
Processed a total of 0 messages
{noformat}

2. Does work
{noformat}
$ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1  --property value.deserializer=org.apache.kafka.common.serialization.LongDeserializer
1000
2500
2000
5500
8000
{noformat}

Without either, the output is
{noformat}
$ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1
?
	?
?
|
@
{noformat}

  was:
kafka-console-consumer: {{--value-deserializer}} is not working but {{--property value.deserializer}} is working


1. Does not work
{noformat}
$ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1  --value-deserializer org.apache.kafka.common.serialization.LongDeserializer
[2017-05-18 13:09:41,745] ERROR Error processing message, terminating consumer process:  (kafka.tools.ConsoleConsumer$)
java.lang.ClassCastException: java.lang.Long cannot be cast to [B
	at kafka.consumer.NewShinyConsumer.receive(BaseConsumer.scala:100)
	at kafka.tools.ConsoleConsumer$.process(ConsoleConsumer.scala:120)
	at kafka.tools.ConsoleConsumer$.run(ConsoleConsumer.scala:75)
	at kafka.tools.ConsoleConsumer$.main(ConsoleConsumer.scala:50)
	at kafka.tools.ConsoleConsumer.main(ConsoleConsumer.scala)
Processed a total of 0 messages
{noformat}

2. Does work
{noformat}
$ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1  --property value.deserializer=org.apache.kafka.common.serialization.LongDeserializer
1000
2500
2000
5500
8000
{noformat}

Without either, the output is
{noformat}
kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1
?
	?
?
|
@
{noformat}


> kafka-console-consumer: `--value-deserializer` is not working but `--property value.deserializer` does
> ------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-5278
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5278
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 0.10.2.1
>            Reporter: Yeva Byzek
>            Priority: Minor
>
> kafka-console-consumer: {{--value-deserializer}} is not working but {{--property value.deserializer}} is working
> 1. Does not work
> {noformat}
> $ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1  --value-deserializer org.apache.kafka.common.serialization.LongDeserializer
> [2017-05-18 13:09:41,745] ERROR Error processing message, terminating consumer process:  (kafka.tools.ConsoleConsumer$)
> java.lang.ClassCastException: java.lang.Long cannot be cast to [B
> 	at kafka.consumer.NewShinyConsumer.receive(BaseConsumer.scala:100)
> 	at kafka.tools.ConsoleConsumer$.process(ConsoleConsumer.scala:120)
> 	at kafka.tools.ConsoleConsumer$.run(ConsoleConsumer.scala:75)
> 	at kafka.tools.ConsoleConsumer$.main(ConsoleConsumer.scala:50)
> 	at kafka.tools.ConsoleConsumer.main(ConsoleConsumer.scala)
> Processed a total of 0 messages
> {noformat}
> 2. Does work
> {noformat}
> $ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1  --property value.deserializer=org.apache.kafka.common.serialization.LongDeserializer
> 1000
> 2500
> 2000
> 5500
> 8000
> {noformat}
> Without either, the output is
> {noformat}
> $ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic TEST1
> ?
> 	?
> ?
> |
> @
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)