The rust client is the core client for all language clients. It has all the features before any of the other clients as well as having good support for the Admin API. This client uses async rust for all blocking calls.



To get a fluvio connection do:

let fluvio = Fluvio::connect().await.expect("Failed to connect to fluvio");


To create a producer do:

let producer = fluvio.topic_producer("my-fluvio-topic").await.expect("Failed to create a producer");


Once you’ve got a producer, send to this topic via:

producer.send("my-key", "my-value").await.expect("Failed to send into a record");


To create a consumer do:

let consumer = fluvio.partition_consumer("my-topic", 0).await.expect("failed to create consumer");


To create a stream do:

let mut stream ="Failed to create stream");

To use the stream do:

use futures::StreamExt;
while let Some(Ok(record)) = {
    let key = record.key().map(|key| String::from_utf8_lossy(key).to_string());
    let value = String::from_utf8_lossy(record.value()).to_string();
    println!("Got event: key={:?}, value={}", key, value);

Refer to the fluvio page for full detail.