Sarama is a Go module that implements an Apache Kafka client. It includes mocks for tests, example applications, and command-line utilities for diagnostics.
Overview
Sarama is a Go client library for Apache Kafka. Applications import it to produce and consume Kafka messages and use Kafka protocol features from Go code.
The project ships supporting material for adoption and verification: a mocks subpackage for testing without a live cluster, an examples directory with sample applications, and command-line tools under tools for testing, diagnostics, and instrumentation. Project documentation covers design and usage details.
Compatibility policy states support for the two latest stable Kafka and Go releases, with a two-month grace period for older releases; older Kafka versions may still work. The module follows semantic versioning for API stability, which matters for downstream services and libraries that pin Go module versions.
Teams choose Sarama when they need a native Go Kafka client rather than clients in other languages, especially where Go services already form the application stack.
Key features
- Apache Kafka protocol client
- Go module with semver API
- Mocks subpackage for unit tests
- Example applications directory
- CLI tools for diagnostics
- Documented compatibility window
- Semantic versioning guarantee
- Project wiki documentation
Use cases
- Go microservices producing to Kafka
- Consumer groups in Go applications
- Kafka integration testing with mocks
- Event-driven backend services
- Instrumentation and diagnostic tooling