Skip to content

andrenmaia/go-avro-serializer-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Go Avro Serializer

A sample code in Go to serialize an object in Avro using goavro.

Kafka

If you want to store your Avro in Kafka, you should serialize your object using with schema registry header information.

Initially, I was using gogen-avro to serialize objects, but the serialization do not include schema registry headers information.

At the end of the day, I decided to select goavro to serialize the object and set header manually.

Dependencies

go get "github.com/linkedin/goavro"

Test

# Build go
cd go-serializer 
go build src/serializer.go;

# Generate file
./serializer
# Print json from avro file
cd ../java-serializer
./gradlew run

The output will be {"code": "code code code 1", "amount": 1}

About

Sample code to serialize Avro Files sweet for Kafka+Schema Registry.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published