confluentinc / confluentinc/libserdes

Help with libserdes example program

Open
#32 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12
Forks
62
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use the ./serdes-kafka-avro-client example as shipped with latest version of libserdes, but I cannot get it to work. Could someone please let me know if it's working code or not? Or maybe I'm not using it as intended. Here's my output:

1). The schema is already registered in schemaregistry:

curl -X GET localhost:60002/subjects/car/versions/latest | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 258 100 258 0 0 15246 0 --:--:-- --:--:-- --:--:-- 16125
{
"subject": "car",
"version": 1,
"id": 22,
"schema": "{"type":"record","name":"Car","fields":[{"name":"Make","type":"string"},{"name":"Model","type":"string"},{"name":"Year","type":"string"},{"name":"MSRP","type":"int"}]}"
}

I start the consumer
./serdes-kafka-avro-client -C -b localhost:60000 -t aamir -p 0 -r localhost:60002
I start the producer
./serdes-kafka-avro-client -P -b localhost:60000 -t aamir -r localhost:60002 -s 22
% Using schema (null) with id 22
% Use "schema: " to specify a new schema
% Use "str: " to produce an Avro-encoded string
% Ctrl-D to exit

I enter just one record from producer
str: {"Make":"BMW","Model":"M-4","Year":"2014","MSRP":55000}

The consumer complains that it cannot deserialize
% serdes_deserialize_avro failed: 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 bufferCannot 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 bufferCannot read string value: Cannot read string length: Cannot read 1 bytes from memory bufferCannot read string value: Can

Can someone please help?

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.