diff options
author | Albin Suresh <albin.suresh@softwareag.com> | 2022-02-04 21:32:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 21:32:32 +0530 |
commit | c15cfc4bee97473411ed173903f808c1132b8d8c (patch) | |
tree | eb9c1337c25b81764ede6ad1834705c62ae72959 /crates/core/tedge_mapper/src/sm_c8y_mapper | |
parent | 43bf45a3bd868586afe83a645be67f5042d9ac5d (diff) |
[#735] Detect and reconcile alarms updated while mapper was down (#791)
* [#735] Detect and reconcile cleared alarms while mapper was down on its restart
* Rust integration test for C8Y mapper
* Rust integration test for alarm syncing on startup
* New publish apis in mqtt_test crate that supports retain flag and QoS
* Refactor alarm conversion logic to dedicated AlarmConverter enum
Diffstat (limited to 'crates/core/tedge_mapper/src/sm_c8y_mapper')
-rw-r--r-- | crates/core/tedge_mapper/src/sm_c8y_mapper/mapper.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/core/tedge_mapper/src/sm_c8y_mapper/mapper.rs b/crates/core/tedge_mapper/src/sm_c8y_mapper/mapper.rs index 3637fe56..88077a09 100644 --- a/crates/core/tedge_mapper/src/sm_c8y_mapper/mapper.rs +++ b/crates/core/tedge_mapper/src/sm_c8y_mapper/mapper.rs @@ -32,7 +32,7 @@ use serde::{Deserialize, Serialize}; use std::path::PathBuf; use std::{convert::TryInto, process::Stdio}; -use tedge_config::TEdgeConfig; +use tedge_config::{ConfigSettingAccessor, MqttPortSetting, TEdgeConfig}; use tracing::{debug, error, info, instrument}; const AGENT_LOG_DIR: &str = "/var/log/tedge/agent"; @@ -125,7 +125,9 @@ where operations: Operations, ) -> Result<Self, anyhow::Error> { let mqtt_topic = CumulocitySoftwareManagementMapper::subscriptions(&operations)?; - let mqtt_config = crate::mapper::mqtt_config(SM_MAPPER, &tedge_config, mqtt_topic)?; + let mqtt_port = tedge_config.query(MqttPortSetting)?.into(); + + let mqtt_config = crate::mapper::mqtt_config(SM_MAPPER, mqtt_port, mqtt_topic)?; let client = Connection::new(&mqtt_config).await?; Ok(Self { |