mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-07-02 03:11:36 +00:00
4ea12087f2
paho defaults (CleanSession=true, empty random ClientID per reconnect,
Order=true) caused the staging ingestor to receive ~7 msg/h while
mosquitto_sub on the same broker/creds/topics received ~6720/h — a 200x
gap. Every watchdog-driven reconnect (~every 5min) made the broker treat
us as a brand-new session and drop the queued backlog.
buildMQTTOpts now sets:
- SetClientID("corescope-ingestor-<hostname>-<source-tag>")
persistent + unique across sources, stable across restarts
- SetCleanSession(false)
broker keeps subscription state across reconnects and replays the
backlog we missed
- SetKeepAlive(30 * time.Second)
paho-level half-open detection (was unset; relying on OS keepalive)
- SetOrderMatters(false)
handler dispatch is parallel; one slow packet no longer stalls all
others under burst load
The existing watchdog (#1212/#1216) is untouched. Reconnect throttle
(MaxReconnectInterval=30s) is unchanged — no reconnect storm.
Fixes #1337