Skip to content

Latest commit

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

metamorphosis

metamorphosis is a Go client for easily interacting with Kafka. It works best when used to handle a Kafka setup that's clustered with Zookeeper and whose messages are encoded with Avro.

Usage

import"github.com/FoxComm/metamorphosis"

Construct a new consumer by creating a Consumer that connects to Zookeeper and the Avro schema registry and provide offset reset strategy value ("largest" or "smallest").

For example:

zookeeper:="localhost:2181"schemaRepo:="http://localhost:8081"resetOffsetStrategy:="smallest"// or "largest"consumer, err:=metamorphosis.NewConsumer(zookeeper, schemaRepo, resetOffsetStrategy)

To handle messages, define a handler and run against a topic:

handler:=func(messageAvroMessage) error {
bytes:=message.Bytes()
fmt.Println(string(bytes))
returnnil
}
consumer.RunTopic("my_topic", handler)

License

MIT

About

The simple Kafka client in GoLang! Read and transform messages with ease.

Resources

Stars

3 stars

Watchers

23 watching

Forks

Releases

Packages

Used by

Contributors

Languages