On this page
Overview
kafka-go is a Kafka client library for Go. It provides a low-level Conn plus higher-level Reader and Writer APIs, using Go contexts and standard-library-like interfaces for Kafka connectivity.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Build consumers and producers with Reader and Writer
Reader handles reconnections, offset management, and context cancellation or timeouts, while Writer provides a higher-level producer API. Consumer-group usage is also supported.
Sources: [2]
Drop down to Conn for partition- and protocol-oriented operations
Conn wraps a network connection to a Kafka server and acts as a building block for lower-level reads, writes, topic administration, and metadata operations.
Sources: [2]
Best fit
Fits Go backends that want a pure-Go Kafka client with idiomatic APIs
It is useful for event-driven services and data pipelines that value contexts, Reader/Writer abstractions, and avoiding cgo dependencies.
Sources: [2]
Before adoption
v0.4.51 declares Go 1.23; validate broker-feature compatibility against the client surface
The v0.4.51 go.mod declares Go 1.23. The README documents testing against Kafka 0.10.1.0 through 2.7.1 and notes that later brokers may work while newer Kafka APIs can be unimplemented. Test producer, consumer-group, SASL/TLS, error, and retry paths against the actual broker version.
Official sources
- [1]segmentio/kafka-go — GitHub repository(2026-10-06)
- [2]kafka-go v0.4.51 — README(2026-10-06)
- [3]kafka-go v0.4.51 — go.mod(2026-10-06)
- [4]kafka-go v0.4.51 release(2026-10-06)
- [5]kafka-go MIT license(2026-10-06)
Supplemental curator note
kafka-go follows Go-standard-library conventions and lets applications choose between low-level Conn and higher-level Reader/Writer APIs. Validate broker compatibility, consumer-group commits and rebalances, retries, and timeouts under production conditions.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/segmentio/kafka-go.git - 2
Enter the repository
cd kafka-go - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
8,638 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 84
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- kafka
- golang
- go
- segment
- kafka-client
- consumer
- producer
- golang-library
- golang-native
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Asynq13,748 Stars
2 shared tag(s) · Same language
distribute background tasks to Redis-backed worker queues with retries and scheduling
Go - Grafana Tempo5,510 Stars
2 shared tag(s) · Same language
store high-volume distributed traces around object storage and explore them with TraceQL
Go - Sarama12,523 Stars
5 shared tag(s) · 2 shared category(s) · Same language
cover Kafka producers, consumer groups, administration, and transactions from Go
Go - NATS Go Client6,770 Stars
3 shared tag(s) · 1 shared category(s) · Same language
use Core NATS Pub/Sub and persistent JetStream messaging through one Go client
Go - Apache Kafka33,916 Stars
3 shared tag(s) · 1 shared category(s)
Store durable events in topics and partitions and build distributed pipelines with producers, consumers, Streams, and Connect
Java - RabbitMQ13,905 Stars
3 shared tag(s) · 1 shared category(s)
unify AMQP, MQTT, STOMP, and stream protocols over queues and replicated logs in one messaging broker
JavaScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.