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

Enabled TOS 2 for MQTT to ensure higher quality #158

Merged
merged 2 commits into from
Jan 26, 2025

Conversation

cedricve
Copy link
Member

@cedricve cedricve commented Jan 26, 2025

Description

Pull Request Description

Title: Enabled TOS 2 for MQTT to Ensure Higher Quality

Motivation and Improvement

This pull request focuses on enhancing the quality and reliability of our MQTT communication by enabling Quality of Service (QoS) level 2. QoS 2 ensures that messages are delivered exactly once, which is critical for applications where duplicate messages can cause issues or where message loss is unacceptable.

Changes Made

  1. Updated MQTT Publish QoS Level:

    • Changed the QoS level from 0 (at most once) to 2 (exactly once) for all MQTT publish operations.
    • This change was applied across multiple files and functions, ensuring consistent and reliable message delivery.

    Example changes:

    - mqttClient.Publish("kerberos/hub/"+hubKey, 0, false, payload)
    + mqttClient.Publish("kerberos/hub/"+hubKey, 2, false, payload)
  2. Files Modified:

    • machinery/src/cloud/Cloud.go
    • machinery/src/computervision/main.go
    • machinery/src/routers/mqtt/main.go

Benefits

  1. Improved Reliability:

    • Ensures that each message is delivered exactly once, preventing potential issues caused by message duplication or loss.
    • Particularly important in scenarios where precise and reliable communication is critical.
  2. Enhanced Quality:

    • Aligns with best practices for MQTT communication, providing a more robust and fault-tolerant system.
    • Reduces the risk of data inconsistency and enhances overall system stability.

By enabling QoS 2 for MQTT, we significantly improve the communication reliability and quality of our system, ensuring that messages are delivered exactly once, which is crucial for maintaining data integrity and system performance.

@cedricve cedricve merged commit 4548d53 into master Jan 26, 2025
10 checks passed
@cedricve cedricve deleted the fix/force-mqtt-tos-level-2 branch January 26, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant