Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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);
```