Crates.io | sbkafka |
lib.rs | sbkafka |
version | 0.1.0 |
source | src |
created_at | 2022-03-19 18:59:51.647088 |
updated_at | 2022-03-19 18:59:51.647088 |
description | Easy consumption of rdkafka |
homepage | https://github.com/robbestad/sbkafka |
repository | |
max_upload_size | |
id | 553294 |
size | 5,086 |
#SBKafka
Easy consumption of rdkafka
use {
sbkafka::{subscribe,publisher}
};
let consume = subscribe;
let _producer = publisher(&args);
consume(&args,&process_msg).await;
fn process_msg(message:&BorrowedMessage) {
let payload = message
.payload_view::<str>()
.unwrap_or(Ok(""))
.unwrap_or_else(|e| {
error!("Error while deserializing payload: {:?}", e);
""
});
}
let producer = publisher(&args);