Async wrappers for rustfs-kafka, built on top of tokio.
This crate provides:
AsyncKafkaClientAsyncProducerAsyncProducerBuilderAsyncConsumerAsyncConsumerBuilderThe current implementation uses native tokio async I/O for metadata, produce/fetch, and commit request paths.
Security flow supports TLS and SASL authentication in native async mode,
including PLAIN, SCRAM-SHA-256, and SCRAM-SHA-512.
[dependencies]
rustfs-kafka-async = "1.2.0"
use rustfs_kafka::producer::Record;
use rustfs_kafka_async::AsyncProducer;
#[tokio::main]
async fn main() -> rustfs_kafka::Result<()> {
let producer = AsyncProducer::builder(vec!["localhost:9092".to_owned()])
.with_client_id("example-async-producer".to_owned())
.build()
.await?;
producer.send(&Record::from_value("my-topic", b"hello async")).await?;
producer.flush().await?;
producer.close().await?;
Ok(())
}
rustfs-kafka.PLAIN, SCRAM-SHA-256, and SCRAM-SHA-512.docs/usage-guide.md in the repository.