6.5 Background retry queue

On publish failure, enqueue the MAC in a dedup'd in-memory set and let a
background loop retry with the configured backoff sequence. Reconnects
signal an immediate drain so a transient broker outage no longer drops
the update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 15:42:47 +02:00
parent 0f681753c1
commit d94009690c
2 changed files with 157 additions and 28 deletions

View File

@@ -167,7 +167,7 @@ Each type lives in `src/FrameProcessor/Domain/`. Tests in `tests/FrameProcessor.
### [x] 6.4 `/health` reports MQTT status
- Replace hardcoded `mqttConnected` with `MqttPublisher.IsConnected`.
### [ ] 6.5 Background retry queue
### [x] 6.5 Background retry queue
- In-memory `Channel<MacAddress>` (one slot per frame; newer publish supersedes older — per `SPEC.md` §5.1 "Multiple queued publishes for the same frame collapse to the most recent one").
- Background loop drains with backoff sequence from `MqttOptions.RetryBackoffSeconds`.
- On reconnect, drain immediately.