A pure Rust client library for Apache Kafka with consumer, producer, and client APIs.
kafka-rust is a native Rust client library for Apache Kafka that provides safe and efficient interaction with Kafka clusters from Rust applications. It offers both high-level consumer and producer APIs for common messaging patterns and a mid-level client for more direct control over operations like metadata loading and offset management.
Rust developers building applications that need to produce to or consume from Apache Kafka clusters, particularly those prioritizing a pure Rust implementation with minimal dependencies.
Developers choose kafka-rust for its idiomatic Rust design, safety focus, and pure Rust dependencies like rustls for TLS, which improve portability and simplify builds compared to bindings to C libraries. It offers flexibility with both high-level convenience APIs and mid-level control, tested across a wide range of Kafka versions from 0.8.2 to 3.1.0.
Rust client for Apache Kafka
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Default use of rustls provides a dependency-light, portable, and modern TLS 1.2+ implementation without OpenSSL hassles, simplifying cross-compilation and security.
Tested with Kafka versions from 0.8.2 to 3.1.0, ensuring support for legacy and newer clusters, as noted in the compatibility section.
Offers high-level Consumer/Producer APIs for convenience with automatic offset management and partitioner support, plus mid-level KafkaClient for direct control over metadata and offsets.
Prioritizes Rust's safety principles with automatic offset handling and partitioners, reducing common errors in message processing.
The README admits that not all features from Kafka 0.9 and newer are supported yet, limiting access to latest Kafka capabilities like exactly-once delivery.
Explicitly warns users to 'use it in production at your own risk' due to acknowledged bugs and insufficient testing coverage, making it risky for critical deployments.
OpenSSL support is deprecated and will be removed in the next major version, forcing existing users to migrate to rustls, which may require code and configuration changes.
Relies primarily on examples in API docs rather than comprehensive guides, which can slow onboarding for complex scenarios or edge cases.