From e22b2038d0bd6efb0e014e7adc5f2ac27886d78a Mon Sep 17 00:00:00 2001 From: Fritiof Hedman Date: Tue, 3 Nov 2026 18:51:43 +0100 Subject: [PATCH] Add MQTT reconnect, keep-alive and connect timeout options Co-Authored-By: Claude Opus 5.5 (1M context) --- appsettings.json | 5 ++++- src/FrameProcessor/Configuration/MqttOptions.cs | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/appsettings.json b/appsettings.json index 9492e16..673c7da 100644 --- a/appsettings.json +++ b/appsettings.json @@ -8,7 +8,10 @@ "UseTls": false, "BaseTopic": "frames", "PublishQos": 1, - "RetryBackoffSeconds": [1, 2, 5, 15, 60] + "RetryBackoffSeconds": [1, 2, 5, 15, 60], + "ReconnectBackoffSeconds": [1, 2, 5, 15, 30], + "KeepAliveSeconds": 15, + "ConnectTimeoutSeconds": 10 }, "ApiKey": "change-me", "Storage": { diff --git a/src/FrameProcessor/Configuration/MqttOptions.cs b/src/FrameProcessor/Configuration/MqttOptions.cs index 6c7c845..fb2eb96 100644 --- a/src/FrameProcessor/Configuration/MqttOptions.cs +++ b/src/FrameProcessor/Configuration/MqttOptions.cs @@ -32,4 +32,13 @@ public sealed class MqttOptions [MinLength(1)] public int[] RetryBackoffSeconds { get; set; } = Array.Empty(); + + [MinLength(1)] + public int[] ReconnectBackoffSeconds { get; set; } = [1, 2, 5, 15, 30]; + + [Range(1, 3600)] + public int KeepAliveSeconds { get; set; } = 15; + + [Range(1, 300)] + public int ConnectTimeoutSeconds { get; set; } = 10; }