Function fluvio::consumer[][src]

pub async fn consumer<S: Into<String>>(
    topic: S,
    partition: i32
) -> Result<PartitionConsumer, FluvioError>

Creates a producer that receives events from the given topic and partition

This is a shortcut function that uses the current profile settings. If you need to specify any custom configurations, try directly creating a Fluvio client object instead.


use futures::StreamExt;
let consumer = fluvio::consumer("my-topic", 0).await?;
let mut stream =;
while let Some(Ok(record)) = {
    let string = String::from_utf8_lossy(record.as_ref());
    println!("Got record: {}", string);