crabka-protocol
Apache Kafka wire-protocol codec for Rust. Implements every message
type Apache Kafka 4.2.0 defines (189 messages, 604 (api_key, version)
pairs), with byte-level wire compatibility verified against the JVM
kafka-clients implementation.
Quick start
use BytesMut;
use ;
use ApiVersionsRequest;
let req = default;
let mut buf = with_capacity;
req.encode.unwrap;
let mut cur: & = &buf;
let decoded = decode.unwrap;
assert_eq!;
Features
- Two flavors per message: owned (
crate::owned::*) and zero-copy borrowed (crate::borrowed::*). - Typed
RecordBatchv2 viacrate::records::*, with eager decompression throughcrabka-compression. - Central
ApiKeyenum listing every Kafka 4.2 API.
Cargo features
Default features enable all four compression codecs. Disable per-codec
via --no-default-features + selective --features:
= { = "0.1", = false, = ["snappy", "zstd"] }
MSRV
Rust 1.95.0.
License
Apache-2.0. Derivative work of Apache Kafka; see NOTICE.