As I remember this is to complain the fist byte of msg is not x00. I think console producer does not support json since it uses string schema.
Thanks, Dayong > On Nov 23, 2016, at 4:28 AM, ZHU Hua B <hua.b....@alcatel-lucent.com> wrote: > > Hi, > > > We tried to produce and consume a AVRO message (zookeeper, broker and schema > registry have been launched), error "Unknown magic byte" occurred while > deserializing Avro message, if I missed anything? Thanks! > > > From producer: > # 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:/root/confluent/share/java/kafka-serde-tools/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] > SLF4J: Found binding in > [jar:file:/root/confluent/share/java/confluent-common/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] > SLF4J: Found binding in > [jar:file:/root/confluent/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"} > > > From consumer: > # 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:/root/confluent/share/java/kafka-serde-tools/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] > SLF4J: Found binding in > [jar:file:/root/confluent/share/java/confluent-common/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] > SLF4J: Found binding in > [jar:file:/root/confluent/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] > > [2016-11-23 16:15:11,108] ERROR Unknown error when running consumer: > (kafka.tools.ConsoleConsumer$:103) > 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-23 16:15:11,108] ERROR Unknown error when running consumer: > (kafka.tools.ConsoleConsumer$:103) > org.apache.kafka.common.errors.SerializationException: Error deserializing > Avro message for id -1 > Caused by: org.apache.kafka.common.errors.SerializationException: Unknown > magic byte! > > > Best Regards > > Johnny >