Skip to content

Commit

Permalink
refactor: include topic prefix in c8y last-will service name
Browse files Browse the repository at this point in the history
Signed-off-by: James Rhodes <[email protected]>
  • Loading branch information
jarhodes314 committed Sep 5, 2024
1 parent dcf395a commit 7615466
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/core/tedge_mapper/src/c8y/mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ pub fn service_monitor_client_config(
.clone()
.parse()
.context("Invalid device_topic_id")?;
let prefix = &tedge_config.c8y.bridge.topic_prefix;

let mapper_service_topic_id = entity_topic_id
.default_service_for_device(c8y_mapper_name)
Expand All @@ -294,12 +295,12 @@ pub fn service_monitor_client_config(
service_type.as_str(),
"down",
&[],
&tedge_config.c8y.bridge.topic_prefix,
prefix,
)?;

let mqtt_config = tedge_config
.mqtt_config()?
.with_session_name("last_will_c8y_mapper")
.with_session_name(format!("last_will_{prefix}_mapper"))
.with_last_will_message(last_will_message);
Ok(mqtt_config)
}

0 comments on commit 7615466

Please sign in to comment.