Skip to content

Commit

Permalink
update to use new serialization (#232)
Browse files Browse the repository at this point in the history
* update to use new serialization

* Update Cargo.toml, point to Eclipse-Zenoh/main
  • Loading branch information
Charles-Schleich authored Oct 1, 2024
1 parent c965e8b commit 5d93bc2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
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

0 comments on commit 5d93bc2

Please sign in to comment.