kafka-rust

rustfs-kafka

Rust crates.io docs.rs License Crates.io

Fork project: forked from kafka-rust.

rustfs-kafka is a Rust Kafka client workspace containing:

Current release target: 1.4.0.

Crates

[dependencies]
rustfs-kafka = "1.4.0"
rustfs-kafka-async = "1.4.0"

Core Features

Feature Flags (rustfs-kafka)

Feature Default Description
security Yes rustls + aws-lc-rs TLS backend
security-ring No rustls + ring TLS backend
compression Yes gzip, snappy, lz4, and zstd codecs
gzip Yes gzip record batch codec
snappy Yes snappy record batch codec
lz4 Yes lz4 record batch codec
zstd Yes zstd record batch codec
metrics No metrics integration
producer_timestamp No producer timestamp support
nightly No nightly-only optimizations
integration_tests No integration test compilation helpers

Default builds include Kafka record batch compression support. For smaller builds, disable default features and enable only the codecs you need, for example features = ["security", "gzip"].

Runtime Behavior

TransactionalProducer uses a separate transaction coordinator and sends transaction IDs, producer identities, epochs, and sequences in transactional batches. Commit and abort preserve sequence state. A transaction RPC failure blocks further reuse; construct a new producer instead of retrying that instance. Transactional consumer-offset workflows and read-committed high-level consumers remain follow-up work. GroupCoordinator discovers coordinators and uses each member’s subscription for assignments; callers schedule its manual heartbeat method. Automatic heartbeat and rebalance scheduling remain follow-up work. Further lifecycle work is tracked in rustfs/backlog#2713.

Documentation

Local Development

The child crate manifests omit explicit rust-version metadata. The workspace retains its compiler reference alongside the Rust 2024 edition and dependency declarations in Cargo.toml.

cargo build
cargo test
cargo clippy --all-targets --all-features -- -D warnings

Integration tests (Docker required):

cd crates/rustfs-kafka/tests
./run-all-tests
./run-sync-secure-tests
./run-async-secure-tests

License

Apache License 2.0. See LICENSE.