Battling to marshal & serialize struct into avro object

Need some assistance, please.

Made lots of cleanup, stuck on a avro.marshal step atm…if anyone can have a look, trying to redo my app (use to be Protobuf based) to be avro based as far as the kafka produce is concerned.

see main.go lines 1000-1015
schema def is in ./topics (schema_salesbaskets.json)
err:

BasketItems: avro: unable to resolve type types.TPBasketItems

G

Seems some of what I did got it pass the avro.Marshal(BasketSchema, strct_SalesBasket) now…

crashing on err = json.Unmarshal(avro_bytes, &msg)
now

2024/07/14 11:08:37 FATAL: Failed to UnMarhsal (Sales Basket) avro_bytes to interface{}: invalid character 'H' looking for beginning of value```
G

Got it all working,
Found: confluent-kafka-go/examples/avrov2_producer_example/avrov2_producer_example.go at dd336f6fb0bf4637e6bd3f561a7adec202c93138 · confluentinc/confluent-kafka-go · GitHub which worked nicely with generic structure and my created Avro schema/schema registry.
Repo has been updated with working code./version.
G

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.