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

feat: add MQTT keepalive_interval config to allow custom value per bridge #3365

Conversation

rina23q
Copy link
Member

@rina23q rina23q commented Jan 27, 2025

Proposed changes

As per the request in #3153, add <cloud>.bridge.keepalive_interval to the tedge config settings.
Example usage:

tedge config set c8y.bridge.keepalive_interval 60s

With mosquitto, the value will be shown explicitly in c8y-bridge.conf as :

### Bridge
....
keepalive_interval 60

Using 60s as default as I found 60 seconds is the default for both mosquitto and rumqttc.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

#3153

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Copy link

codecov bot commented Jan 27, 2025

Copy link
Contributor

github-actions bot commented Jan 28, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
556 0 2 556 100 1h29m27.124075s

@rina23q rina23q temporarily deployed to Test Pull Request January 28, 2025 12:17 — with GitHub Actions Inactive
@rina23q rina23q changed the title Add MQTT keepalive_interval config to allow custom value per bridge feat: add MQTT keepalive_interval config to allow custom value per bridge Jan 28, 2025
Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

Unrelated to this PR:

  • The changes for c8y, az and aws bridges are so similar that it sounds as a failure to be DRY. Actually, the main point is to configure a mosquitto bridge and one should have a mosquitto::bridge abstraction, not an abstraction per cloud.

Copy link
Contributor

@albinsuresh albinsuresh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


/// The amount of time after which the bridge should send a ping if no other traffic has occured
#[tedge_config(example = "60s", default(from_str = "60s"))]
keepalive_interval: SecondsOrHumanTime,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional:

Suggested change
keepalive_interval: SecondsOrHumanTime,
keep_alive_interval: SecondsOrHumanTime,

Copy link
Contributor

@albinsuresh albinsuresh Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take that back, after noticing that the term keepalive is kinda like the norm across protocols like HTTP and GRPC.

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
@rina23q rina23q force-pushed the feature/3153/configurable-mqtt-keepalive-interval-to-cloud-bridge branch from 45bf3d9 to 2a5a2ec Compare January 29, 2025 12:34
@rina23q rina23q temporarily deployed to Test Pull Request January 29, 2025 12:35 — with GitHub Actions Inactive
@rina23q rina23q added theme:mqtt Theme: mqtt and mosquitto related topics theme:configuration Theme: Configuration management theme:bridge Built-in (Rust) bridge topics labels Jan 29, 2025
@rina23q rina23q added this pull request to the merge queue Jan 29, 2025
Merged via the queue into thin-edge:main with commit ce649ba Jan 29, 2025
33 checks passed
@rina23q rina23q deleted the feature/3153/configurable-mqtt-keepalive-interval-to-cloud-bridge branch January 29, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:bridge Built-in (Rust) bridge topics theme:configuration Theme: Configuration management theme:mqtt Theme: mqtt and mosquitto related topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants