Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to use new serialization #232

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 26 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ntex-mqtt = "3.1.0"
ntex-tls = "2.2.0"
regex = "1.7.1"
rustc_version = "0.4"
rustls = { version = "0.23.13", default-features = false, features = [ "ring" ] }
rustls = { version = "0.23.13", default-features = false, features = ["ring"] }
rustls-pemfile = "2.0.0"
rustls-pki-types = "1.1.0"
secrecy = { version = "0.8.0", features = ["alloc", "serde"] }
Expand All @@ -53,12 +53,19 @@ zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.g
"unstable",
"internal",
"internal_config",

] }
zenoh-config = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false }
zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = [
"unstable",
] }
zenoh-plugin-mqtt = { version = "1.0.0-dev", path = "zenoh-plugin-mqtt/", default-features = false }
zenoh-plugin-rest = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features=["static_plugin"]}
zenoh-plugin-rest = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = [
"static_plugin",
] }
zenoh-plugin-trait = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false }


[profile.release]
codegen-units = 1
debug = false
Expand Down
4 changes: 2 additions & 2 deletions zenoh-plugin-mqtt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,10 @@ fn treat_admin_query(query: Query, admin_keyexpr_prefix: &keyexpr, config: &Conf
// send replies
for (ke, v) in kvs.drain(..) {
let admin_keyexpr = admin_keyexpr_prefix / ke;
match ZBytes::try_from(v) {
match serde_json::to_vec(&v) {
Ok(bytes) => {
if let Err(e) = query
.reply(admin_keyexpr, bytes)
.reply(admin_keyexpr, ZBytes::from(bytes))
.encoding(Encoding::APPLICATION_JSON)
.wait()
{
Expand Down
2 changes: 1 addition & 1 deletion zenoh-plugin-mqtt/src/mqtt_session_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn route_zenoh_to_mqtt(
sample.key_expr(),
topic
);
let v: Vec<_> = sample.payload().into();
let v: Vec<_> = sample.payload().to_bytes().to_vec();
tx.try_send((topic, v.into())).map_err(|e| {
zerror!(
"MQTT client {}: error re-publishing on MQTT a Zenoh publication on {}: {}",
Expand Down