Skip to content

Commit

Permalink
tedge-agent skip legacy topic subscription when running as a child de…
Browse files Browse the repository at this point in the history
…vice

Signed-off-by: Reuben Miller <[email protected]>
  • Loading branch information
reubenmiller committed Aug 1, 2024
1 parent cb07dc9 commit 21cae14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/core/tedge_agent/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,6 @@ impl Agent {
&self.config.service,
);

// Tedge to Te topic converter
let tedge_to_te_converter = create_tedge_to_te_converter(&mut mqtt_actor_builder)?;

let mut fs_watch_actor_builder = FsWatchActorBuilder::new();
let mut downloader_actor_builder = DownloaderActor::new(
self.config.identity.clone(),
Expand Down Expand Up @@ -347,6 +344,8 @@ impl Agent {
if is_main_device {
info!("Running as a main device, starting tedge_to_te_converter and File Transfer Service");

// Tedge to Te topic converter
let tedge_to_te_converter = create_tedge_to_te_converter(&mut mqtt_actor_builder)?;
runtime.spawn(tedge_to_te_converter).await?;

let file_transfer_server_builder =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Run agent with a custom topic prefix #3031
Should Not Contain ${output} te/
Should Contain ${output} custom_root/device/customname//

tedge-agent should not subscribe to legacy topics when running as a child device #3034
# Only run tedge-agent for a few seconds
${output}= Execute Command timeout 5 tedge-agent --mqtt-device-topic-id "device/pump//" 2>&1 ignore_exit_code=${True}
Should Contain ${output} Running as a child device, tedge_to_te_converter and File Transfer Service disabled
Should Not Contain ${output} item=${SPACE}tedge/


*** Keywords ***

Expand Down

0 comments on commit 21cae14

Please sign in to comment.