sbkafka

Crates.iosbkafka
lib.rssbkafka
version0.1.0
sourcesrc
created_at2022-03-19 18:59:51.647088
updated_at2022-03-19 18:59:51.647088
descriptionEasy consumption of rdkafka
homepagehttps://github.com/robbestad/sbkafka
repository
max_upload_size
id553294
size5,086
Sven Anders Robbestad (robbestad)

documentation

README

#SBKafka

Easy consumption of rdkafka

import

use {
    sbkafka::{subscribe,publisher}
};

To consume

let consume = subscribe;
let _producer = publisher(&args);
consume(&args,&process_msg).await;

where process_msg is:

fn process_msg(message:&BorrowedMessage) {
    let payload = message
    .payload_view::<str>()
    .unwrap_or(Ok(""))
    .unwrap_or_else(|e| {
        error!("Error while deserializing payload: {:?}", e);
        ""
    });
}

To produce

let producer = publisher(&args);
Commit count: 0

cargo fmt