mlua-kafka 0.1.6

A Rust-native implementation of lua-kafka for mlua.
docs.rs failed to build mlua-kafka-0.1.6
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: mlua-kafka-0.1.0

mlua-kafka

A Rust-native implementation of lua-kafka for mlua.

License Arch Lua

Installing

Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].

$ cargo add mlua-kafka --features luajit

Using

use mlua::Lua;

let lua = Lua::new();
mlua_kafka::preload(&lua);
let script = r#"
    local settings = {
        ['bootstrap.servers'] = '127.0.0.1:9092',
    }
    local producer = require('kafka').producer(settings)
    producer:produce('topic', 'mykey', 'myvalue')
    producer:flush(100)
"#;
lua.load(script).exec()?;

Integration Testing

$ KAFKA_BROKERS=127.0.0.1:9092 KAFKA_TOPIC=mytopic cargo test