Skip to content

Commit db332aa

Browse files
fix: call publish_with_reply when reply_to is present (#216)
* fix: call publish_with_reply when reply_to is present Signed-off-by: Gabber235 <gabber200@icloud.com> * Update crates/wash-runtime/src/washlet/plugins/wasmcloud_messaging.rs Co-authored-by: Aditya Salunkhe <aditya.salunkh919@gmail.com> Signed-off-by: Gabber235 <gabber200@icloud.com> * Update crates/wash-runtime/src/washlet/plugins/wasmcloud_messaging.rs Co-authored-by: Aditya Salunkhe <aditya.salunkh919@gmail.com> Signed-off-by: Gabber235 <gabber200@icloud.com> --------- Signed-off-by: Gabber235 <gabber200@icloud.com> Co-authored-by: Aditya Salunkhe <aditya.salunkh919@gmail.com>
1 parent 5006b8c commit db332aa

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

crates/wash-runtime/src/washlet/plugins/wasmcloud_messaging.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,22 @@ impl Host for Ctx {
8787
return Ok(Err("plugin not available".to_string()));
8888
};
8989

90-
plugin
91-
.client
92-
.publish(msg.subject, msg.body.into())
93-
.await
94-
.context("failed to send message")?;
90+
let subject = msg.subject;
91+
92+
if let Some(reply_to) = msg.reply_to {
93+
plugin
94+
.client
95+
.publish_with_reply(subject, reply_to, msg.body.into())
96+
.await
97+
.context("failed to send message")?;
98+
} else {
99+
plugin
100+
.client
101+
.publish(subject, msg.body.into())
102+
.await
103+
.context("failed to send message")?;
104+
}
105+
95106
Ok(Ok(()))
96107
}
97108
}

0 commit comments

Comments
 (0)