SerializationException trying to run the latest Quickstart example

206 views
Skip to first unread message

Kal Krishnan

unread,
Nov 9, 2016, 7:07:59 PM11/9/16
to Confluent Platform
Downloaded the zip and unzipped on my MacBook. Was following the Quickstart guide, but hit this snag. Please let me know what I may be doing wrong. Thanks.

Kals-MacBook-Air:confluent-3.1.0 Kal$ ./bin/kafka-avro-console-producer \

>          --broker-list localhost:9092 --topic test \

>          --property value.schema='{"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}'

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/Users/Kal/Devel/Kafka/confluent-3.1.0/share/java/kafka-serde-tools/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/Users/Kal/Devel/Kafka/confluent-3.1.0/share/java/schema-registry/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

{"f1": "value1"}

{"f1":"value2"}

{"f1":"value3"}

^CKals-MacBook-Air:confluent-3.1.0 Kal$ ./bin/kafka-avro-console-consumer --topic test \

>          --zookeeper localhost:2181 \

>          --from-beginning

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/Users/Kal/Devel/Kafka/confluent-3.1.0/share/java/kafka-serde-tools/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/Users/Kal/Devel/Kafka/confluent-3.1.0/share/java/schema-registry/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].

Processed a total of 1 messages

[2016-11-09 15:41:44,033] ERROR Unknown error when running consumer:  (kafka.tools.ConsoleConsumer$:105)

org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id -1

Caused by: org.apache.kafka.common.errors.SerializationException: Unknown magic byte!

[2016-11-09 15:41:44,033] ERROR Unknown error when running consumer:  (kafka.tools.ConsoleConsumer$:105)

org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id -1

Caused by: org.apache.kafka.common.errors.SerializationException: Unknown magic byte!


Kal Krishnan

unread,
Nov 11, 2016, 12:09:07 PM11/11/16
to Confluent Platform
No help at all? Can other users please confirm if the Quickstart commands work for them? Seems like a basic issue here for anyone getting started with the platform!

Dustin Cote

unread,
Nov 11, 2016, 3:27:23 PM11/11/16
to confluent...@googlegroups.com
Hi Kal,

The quickstart commands are working for me.  Have you started the schema registry service?  I would expect the producer to fail to send messages in that case, but I note that I don't see the output I would expect for a topic that was created on the fly.  I've even exactly copy/pasted the commands you've shown and it works fine for me.

Also, can you try consuming the data in the topic with the regular console consumer and see if you have other data in the topic somehow.  This will skip the deserialization step:

./bin/kafka-console-consumer --topic test --zookeeper localhost:2181 --from-beginning



--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/af3aeeca-f89d-4725-b3b6-e8b178106b7d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Dustin Cote
Customer Operations Engineer | Confluent
Follow us: Twitter | blog

Kal Krishnan

unread,
Nov 11, 2016, 4:57:27 PM11/11/16
to Confluent Platform
Thanks, Dustin! You nailed it. Definitely a beginner learning experience here.

I had downloaded both the Apache version of Kafka and the Confluent one, just to compare the two. The Apache quickstart also has you creating a "test" topic and publish and subscribe from it. I had naively assumed that once I kill all those processes the data from the topic is lost, but, of course, it is persisted on disk. That being the whole point, of course, duh.

So, once I modified the script to use a different topic name, everything works as described.

Thanks again,
-Kal.
To post to this group, send email to confluent...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages