We rely on both Go and Kafka a lot at Segment. Unfortunately, the state of the Go client libraries for Kafka at the time of this writing was not ideal. sarama, which is by far the most popular but is quite difficult to work with. It is poorly documented, the API exposes low level concepts of the Kafka protocol, and it doesn't support recent Go features like contexts. It also passes all values as pointers which causes large numbers of dynamic memory allocations, more frequent garbage collections, and higher memory usage. confluent-kafka-go is a cgo based wrapper around librdkafka, which means it introduces a dependency to a C library on all Go code that uses the package. It has much better documentation than sarama but still lacks support for Go contexts. goka is a more recent Kafka client for Go which focuses on a specific usage pattern. It provides abstractions for using Kafka as a message passing bus between services rather than an ordered log of events.

Features

  • Programs do not need to import compression packages
  • Compression codecs are now exposed in the compress sub-package
  • The experimental kafka.Client API has been updated and slightly modified
  • kafka-go is currently compatible with Kafka versions from 0.10.1.0 to 2.1.0
  • kafka-go is currently compatible with golang version from 1.15+
  • The Conn type is the core of the kafka-go package

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow kafka-go

kafka-go Web Site

Other Useful Business Software
Add Two Lines of Code. Get Full APM. Icon
Add Two Lines of Code. Get Full APM.

AppSignal installs in minutes and auto-configures dashboards, alerts, and error tracking.

Works out of the box for Rails, Django, Express, Phoenix, and more. Monitoring exceptions and performance in no time.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of kafka-go!

Additional Project Details

Programming Language

Go

Related Categories

Go Libraries

Registered

2022-01-10