From c15cfc4bee97473411ed173903f808c1132b8d8c Mon Sep 17 00:00:00 2001 From: Albin Suresh Date: Fri, 4 Feb 2022 21:32:32 +0530 Subject: [#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 --- crates/core/tedge_mapper/src/sm_c8y_mapper/mapper.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/core/tedge_mapper/src/sm_c8y_mapper') 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 { 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 { -- cgit v1.2.3