# Elegant way in a flow to determine if the MQTT broker is disconnected, connecting or connected?

**URL:** <https://discourse.nodered.org/t/elegant-way-in-a-flow-to-determine-if-the-mqtt-broker-is-disconnected-connecting-or-connected/45865>\
**Category:** General\
**Created:** [18 May 2021 15:52 UTC](https://discourse.nodered.org/t/elegant-way-in-a-flow-to-determine-if-the-mqtt-broker-is-disconnected-connecting-or-connected/45865 "2021-05-18T15:52:13Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 May 2021 16:26 UTC](https://discourse.nodered.org/t/elegant-way-in-a-flow-to-determine-if-the-mqtt-broker-is-disconnected-connecting-or-connected/45865/3 "2021-05-18T16:26:55Z")

</div>

Or you could use a Status node linked to an MQTT node to tell you what the current status is.

Alternatively [this post](https://discourse.nodered.org/t/node-red-contrib-msg-queue-only-storing-not-forwarding-w-active-connection/44274/11) shows a flow for guaranteed delivery via MQTT. It will queue mqtt messages until they get sent successfully. If necessary you can use persistent context to even queue them over a node-red restart. It only guarantees delivery to the MQTT broker though, it does not guarantee that a client successfully receives them from the broker.

---

_[View the full topic](https://discourse.nodered.org/t/elegant-way-in-a-flow-to-determine-if-the-mqtt-broker-is-disconnected-connecting-or-connected/45865)._
