confluentinc / libserdes

Avro Serialization/Deserialization C/C++ library with Confluent schema-registry support
Apache License 2.0
5 stars 64 forks source link

serdes-kafka-avro-client error #14

Open Lnixdb opened 5 years ago

Lnixdb commented 5 years ago

Hi, i use below command to run example ./serdes-kafka-avro-client -P -b 10.202.8.11:40301 -t testschema -p 1 -r http://localhost:8081 -s testvertica -S '{"type":"record","name""testvertica","namespace":"test","fields":[{"name":"f1","type":"string"},{"name":"f2","type":"string"}]}'

enter:str: {"f1":"value2", "f2":"value3"}

./serdes-kafka-avro-client -C -b 10.202.8.11:40301 -t testschema -p 1 -r http://localhost:8081 show error message: Failed to read avro value: Cannot read string value: Cannot read string length: Cannot read 1 bytes from memory bufferCannot read string value: Cannot read string length: Cannot read 1 bytes from memory buffer

JustinAzoff commented 4 years ago

as far as I can tell serdes-kafka-avro-client.c doesn't convert the message from json to avro.. I'm not really sure how it's intended to be used.

The cpp example, kafka-serdes-avro-console-producer.cpp has code for this though in the json2avro function

hongbo-miao commented 3 months ago

I succeed and provide full code at https://github.com/confluentinc/libserdes/issues/60 ☺️