
Why MQTT Last Will Testament Isn't Enough for Production IoT (And What We Built Instead)
Why MQTT Last Will Testament Isn't Enough for Production IoT (And What We Built Instead) I spent 7 years building cloud backends — but when I tried connecting real hardware (ESP32s in my home), I hit a wall: "My device shows 'connected' in AWS IoT Core... but hasn't reported data in 4 hours. Is it hung? Dead? Or just offline?" Turns out: MQTT's Last Will Testament (LWT) lies to you. The Lie: "Connected" ≠ Alive LWT triggers only on TCP disconnect . But real devices fail silently: WiFi drops but TCP socket stays open (NAT timeout = 5+ minutes) Device freezes but doesn't reboot (watchdog failed) Sensor loop crashes but MQTT client still "connected" Result? Your dashboard shows "✅ Online" while the device hasn't sent data since yesterday. Our Fix: Application-Level Heartbeats + Stateful ACKs We built a lightweight Spring Boot backend ( hear-beat ) that treats telemetry as heartbeat pulses — not just data. Device → [temp=28°C, ts=1708512000] → Backend Backend → "ACK @ 1708512000" → Device
Continue reading on Dev.to
Opens in a new tab




