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

refactor: include topic prefix in c8y last-will service name #3108

Merged
Merged
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
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)
}