You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a wasm project on Ubuntu system. This project uses kafka consumer.
This is Cargo.toml
[package]
name = "wds-sterling-emulator"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = { version = "0.2", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = "0.6.5"
serde_json = "1.0"
js-sys = "0.3"
web-sys = "0.3"
kafka = "0.10.0"
getrandom = { version = "0.2", features = ["js"] }
openssl = { version = "0.10.64", features = ["vendored"] }
openssl-sys = { version = "0.9.99", features = ["vendored"] }
This is lib.rs
use wasm_bindgen::prelude::*;
use serde::{Deserialize, Serialize};
use serde_wasm_bindgen::to_value;
use kafka::consumer::{Consumer, FetchOffset, GroupOffsetStorage};
#[wasm_bindgen]
pub fn consume_symbollist() -> String {
let hosts = vec!["localhost:9092".to_owned()];
let topic = "my-topic";
let group_id = "my-group";
let mut consumer = Consumer::from_hosts(hosts)
.with_topic(topic.to_owned())
.with_group(group_id.to_owned())
.with_fallback_offset(FetchOffset::Earliest)
.with_offset_storage(Some(GroupOffsetStorage::Kafka))
.create()
.expect("Failed to create Kafka consumer");
let mut message_count = 0;
let mut result = String::new();
for ms in consumer.poll().unwrap().iter().take(10) {
for m in ms.messages() {
let message = String::from_utf8_lossy(m.value);
result.push_str(&format!("Received message: {}\n", message));
message_count += 1;
}
consumer.consume_messageset(ms).expect("Failed to commit offset");
}
result.push_str(&format!("Consumed {} messages", message_count));
result
}
🤔 Expected Behavior
There should be no issue when compiling
👟 Steps to reproduce
When I run "wasm-pack build", I get "error: failed to run custom build command for openssl-sys v0.9.103"
I already installed pkg-config, libssl-dev
🌍 Your environment
wasm-pack version: 0.13.0
rustc version: 1.81.0
The text was updated successfully, but these errors were encountered:
🐛 Bug description
I am building a wasm project on Ubuntu system. This project uses kafka consumer.
This is Cargo.toml
This is lib.rs
🤔 Expected Behavior
There should be no issue when compiling
👟 Steps to reproduce
When I run "wasm-pack build", I get "error: failed to run custom build command for
openssl-sys v0.9.103
"I already installed pkg-config, libssl-dev
🌍 Your environment
wasm-pack version: 0.13.0
rustc version: 1.81.0
The text was updated successfully, but these errors were encountered: