modulepackage
0.0.0-20200121111552-1df13c28f878
Repository: https://github.com/danlitman/go-kafka-avro.git
Documentation: pkg.go.dev
# README
go-kafka-avro
A library provides consumer/producer to work with kafka, avro and schema registry
Installation
$ go get github.com/dangkaka/go-kafka-avro
Usage
-
Setup kafka, schema-registry
docker-compose up -d
-
Add test messages
go run producer/main.go -n 10
-
Run consumer
go run consumer/main.go
References
- Kafka sarama
- Encodes and decodes Avro data goavro
- Consumer group sarama-cluster
- schema-registry
# Packages
No description provided by the author
# Functions
avroConsumer is a basic consumer to interact with schema registry, avro and kafka.
NewAvroProducer is a basic producer to interact with schema registry, avro and kafka.
No description provided by the author
No description provided by the author
NewSchemaRegistryClient creates a client to talk with the schema registry at the connect string By default it will retry failed requests (5XX responses and http errors) len(connect) number of times.
NewSchemaRegistryClientWithRetries creates an http client with a configurable amount of retries on 5XX responses.
# Structs
AvroEncoder encodes schemaId and Avro message.
No description provided by the author
CachedSchemaRegistryClient is a schema registry client that will cache some data to improve performance.
No description provided by the author
Error holds more detailed information about errors coming back from schema registry.
No description provided by the author
SchemaRegistryClient is a basic http client to interact with schema registry.
# Interfaces
SchemaRegistryClientInterface defines the api for all clients interfacing with schema registry.