Help with libserdes example program

Aperta
#32 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c, kafka
Ambito
backend

Direzione di ricerca

Inizia con l'esempio ./serdes-kafka-avro-client e riproduci i comandi del producer/consumer rispetto allo schema registrato su localhost:60002, usando l'id dello schema 22 e il record Car fornito. Traccia l'output di serializzazione e deserializzazione Avro per identificare perché il consumer non riesce a leggere i campi stringa. Il lavoro è completato quando il consumer dell'esempio deserializza correttamente il record prodotto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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!

Lingua principale
C
Stelle
12
Fork
62
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di confluentinc/libserdes

Tutte le issue di confluentinc/libserdes

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.