-
Notifications
You must be signed in to change notification settings - Fork 53
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
tedge-mapper-aws prints errors for known non-json mosquitto bridge health status messages #2247
tedge-mapper-aws prints errors for known non-json mosquitto bridge health status messages #2247
Conversation
Codecov Report
Additional details and impacted files
|
@PradeepKiruvale Wait, we still want to support tedge health messages, we just have to handle the mosquitto bridge related messages properly (I believe we are just ignoring the bridge messages in the tedge-mapper-c8y) without throwing an error. |
Agree, I have reverted those changes. Now only avoid traslating the bridge status messages |
@@ -37,44 +37,51 @@ impl AwsConverter { | |||
} | |||
|
|||
fn try_convert(&mut self, input: &MqttMessage) -> Result<Vec<MqttMessage>, ConversionError> { | |||
let default_timestamp = self.add_timestamp.then(|| self.clock.now()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Minor] It could be nice to minimize the diff.
Here, one way to do that is to return early when this is a bridge topic.
// Ignore health status message coming from the bridges
if input.topic.name.starts_with("tedge/health") && input.topic.name.ends_with("bridge") {
return vec![];
}
// ... former code unchanged
if input.topic.name.eq("tedge/health/mosquitto-az-bridge") | ||
|| input.topic.name.eq("tedge/health/mosquitto-aws-bridge") | ||
|| input.topic.name.eq("tedge/health/mosquitto-c8y-bridge") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to avoid exact matches on a the current list of bridge, as adding a new one would break again this mapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, added a function to check the bridge dynamically.
Robot Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Signed-off-by: Pradeep Kumar K J <pkj@softwareag.com>
f59eb84
to
350bed3
Compare
Proposed changes
Ignore health status message coming from the bridge as only json based health messages are supported.
Types of changes
Paste Link to the issue
#2236
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments