OSS TanbouSign in with GitHub

use high-level Reader and Writer APIs or drop down to a low-level pure-Go Kafka connection

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
8,638
Primary language
Go
License
MIT
Repository last updated
Apr 23, 2026
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.

Sources: [3][2][4]

Official sources

  1. [1]segmentio/kafka-go — GitHub repository(2026-10-06)
  2. [2]kafka-go v0.4.51 — README(2026-10-06)
  3. [3]kafka-go v0.4.51 — go.mod(2026-10-06)
  4. [4]kafka-go v0.4.51 release(2026-10-06)
  5. [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. 1

    Get the source

    git clone --depth 1 https://github.com/segmentio/kafka-go.git
  2. 2

    Enter the repository

    cd kafka-go
  3. 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
Check the official README

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

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • kafka
  • golang
  • go
  • segment
  • kafka-client
  • consumer
  • producer
  • golang-library
  • golang-native
Stars
8,638
Forks
864
Watchers
86
Open issues
182
Contributors
144
Owner type
Organization
Primary language
Go
License
MIT
Repository last updated
Apr 23, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?