Closed tphakala closed 3 months ago
The recent updates introduce robust timeout handling and retry logic to MQTT operations within the analysis processor. By leveraging the context
package, the system now supports timeout management for MQTT connections and publishing activities, enhancing reliability and responsiveness during network issues.
Files/Modules | Change Summary |
---|---|
internal/…/actions.go |
Added context for timeout in MQTT Publish . |
internal/…/processor.go |
Added context and retry logic with exponential backoff. |
internal/…/mqtt.go |
Implemented context for connection and publishing timeouts. |
sequenceDiagram
participant Client
participant Processor
participant MQTT
Client->>Processor: Initiate MQTT Publish
Processor->>MQTT: Connect with Context Timeout
MQTT-->>Processor: Connection Successful
Processor->>MQTT: Publish with Context Timeout
MQTT-->>Processor: Publish Acknowledged
Processor-->>Client: Publish Success
Note over Processor,MQTT: Timeout and retry handled internally with exponential backoff
In code's vast meadow, changes bloom,
Context whispers, banishing gloom.
With timeouts swift and retries keen,
MQTT flows, steady and serene.
🐇✨ In this update, we find our way,
Undaunted 'midst the network's fray!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This commit adds a context with a timeout for publishing MQTT messages in the
MqttAction
andClient
structs. This ensures that the publish operation does not block indefinitely and provides better error handling. If the publish operation exceeds the timeout, an error is returned indicating a timeout.