Crates.io | mlua-samsa |
lib.rs | mlua-samsa |
version | 0.1.2 |
source | src |
created_at | 2024-03-02 11:53:33.238809 |
updated_at | 2024-05-11 17:02:19.637118 |
description | Lua bindings for the Samsa kafka client. |
homepage | https://on-prem.net |
repository | https://gitlab.com/megalithic-llc/mlua-samsa.git |
max_upload_size | |
id | 1159627 |
size | 32,722 |
Lua bindings for the Samsa kafka client.
Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].
$ cargo add mlua-samsa --features luajit
use mlua::Lua;
use mlua_samsa;
let lua = Lua::new();
mlua_samsa::preload(&lua)?;
let script = r#"
local samsa = require('samsa')
local bootstrap_addrs = 'localhost:9092'
local topic = 'my-topic'
local producer = samsa.ProducerBuilder:new(bootstrap_addrs, topic):build()
local message = {
partition_id = 0,
topic = topic,
key = 'my-key',
value = 'my-value',
}
producer:produce(message)
"#;
lua.load(script).exec()?;
$ make check
$ KAFKA_BROKERS=127.0.0.1:9092 KAFKA_TOPIC=abc make check