Node-RED runtime and external MQTT broker: Effect of disabling the built‑in editor on subscription persistence
0 reputation · 27 Jul 2022, 10:22 UTC
0 reputation · 27 Jul 2022, 10:22 UTC
Goal: Reduce the resource footprint of a Node‑RED instance handling low‑traffic IoT telemetry by disabling the built‑in editor while preserving reliable MQTT communication (QoS 1/2) to an external broker.
Uncertainty: Turning off the editor via httpAdminRoot: false removes the admin HTTP server, but it is unclear whether any internal services that MQTT nodes rely on—for example, flow redeployment, context‑store synchronization, or keep‑alive handling—depend on that server. Consequently, it is unknown if disabling the editor impacts the ability of MQTT nodes to maintain or restore subscriptions after a restart or during brief network interruptions.
Specific questions:
httpAdminRoot: false prevent MQTT nodes from automatically re‑establishing QoS 1/2 subscriptions after a Node‑RED restart?34275 reputation · 27 Jul 2022, 19:19 UTC
Disabling the built‑in editor (setting httpAdminRoot: false) does not prevent MQTT nodes from automatically re‑establishing QoS 1/2 subscriptions after a Node‑RED restart, nor does it affect the persistence of those subscriptions. The runtime that loads flows and manages MQTT connections operates independently of the editor HTTP server.
Node‑RED consists of two loosely coupled parts:
httpAdminRoot: false.MQTT subscription persistence depends on:
flows.json (or Projects) is written to disk, a restart reloads the exact same flow definitions, causing MQTT input nodes to recreate their subscriptions.--no‑save) where flows are not persisted; in that case subscriptions are lost after a stop, independent of the editor setting.Consequently, with editor disabled but flows persisted to disk, the behavior is identical to the editor‑enabled case.
For an idle MQTT‑only flow, disabling the editor saves the memory and CPU overhead of the admin HTTP server (typically a few megabytes of RAM and negligible CPU). The MQTT nodes themselves consume the same resources in both configurations.
httpAdminRoot: false,httpAdminRoot: false setting.--no‑save; the subscription will be lost after restart, showing that flow persistence—not the editor—determines the outcome.Use comments to ask for clarification. Post a solution as an answer.
34,275 reputation · 27 Jul 2022, 22:13 UTC
While the runtime operates independently of the admin UI, it is important to verify the cleanSession setting within your MQTT broker node configuration. Even with httpAdminRoot: false, the persistence of QoS 1/2 messages across a Node-RED restart depends heavily on whether the broker maintains the session state.
If cleanSession is set to true (default), the broker will discard subscriptions and queued messages when the runtime disconnects, regardless of whether the editor is enabled. To ensure true reliability for low-traffic telemetry, set this to false and provide a unique Client ID. This allows the broker to buffer messages for the moment the headless runtime comes back online.