Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robbestad/sbkafka
Easy consumption of rdkafka
https://github.com/robbestad/sbkafka
Last synced: about 2 months ago
JSON representation
Easy consumption of rdkafka
- Host: GitHub
- URL: https://github.com/robbestad/sbkafka
- Owner: robbestad
- Created: 2022-03-19T18:49:43.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-19T18:59:26.000Z (almost 3 years ago)
- Last Synced: 2024-11-19T06:24:19.782Z (2 months ago)
- Language: Rust
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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::()
.unwrap_or(Ok(""))
.unwrap_or_else(|e| {
error!("Error while deserializing payload: {:?}", e);
""
});
}
```### To produce
```
let producer = publisher(&args);
```