Help us shape the future of Go! Take the 2026 Go Developer Survey

go-kafka

module
v0.0.0-...-0bb0fe6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: BSD-2-Clause

README

Go utils for Kafka

AvroEncoder with Schema-ID for Sarama

To use Kafka with Avro encoded records the schema.AvroEncoder is useful.

encoder := &schema.AvroEncoder{
	SchemaId: 123,
	Content:  avroEncodedByteArray,
}

https://github.com/Shopify/sarama

SchemaRegistry

schema.Registry allow easy get schema ID from kafka schema registry

import "http"
schemaRegistry := schema.Registry{
	SchemaRegistryUrl: "http://schema-registry.example.com",
	HttpClient:        http.DefaultClient,
}
schemaId, err := schemaRegistry.SchemaId(subject, schemaJsonString)

https://github.com/actgardner/gogen-avro/

Run Docker Compose

sudo vi /etc/hosts

127.0.0.1 kafka
127.0.0.1 zookeeper
127.0.0.1 schema-registry
127.0.0.1 ksql-server
docker-compose up

KSQL-Cli

docker run -ti \
--net=kafka \
confluentinc/cp-ksql-cli:5.3.0 \
http://ksql-server:8088

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL