# Messages looping from MySQL to MQTT

**URL:** <https://discourse.nodered.org/t/messages-looping-from-mysql-to-mqtt/11517>\
**Category:** General\
**Created:** [24 May 2019 20:40 UTC](https://discourse.nodered.org/t/messages-looping-from-mysql-to-mqtt/11517 "2019-05-24T20:40:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![loadingaz](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@loadingaz](https://discourse.nodered.org/u/loadingaz)\
**Post date:** [24 May 2019 20:40 UTC](https://discourse.nodered.org/t/messages-looping-from-mysql-to-mqtt/11517/1 "2019-05-24T20:40:04Z")

</div>

Hello,

I'm using MIT app inventor to publish data to MySQL database and from MySQL database to my MQTT broker. Everything is working fine but as soon as I send data from my phone, this data loops every second and never stops on MQTT Broker. What i'm creating is a smoke detector which will beep if it detects smoke, if i trigger off switch it will send it to MQTT Broker to turn it off, but it keeps telling MQTT Broker to turn it off, in case there is a fire next time, smoke detector will be shut down immediately because messages that get published are looping. What can I do to read only new data that comes to MySQL database once?

 ![s](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0b54976ab9c7f6102a03357223948593d73b0319.png)

Please help

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [25 May 2019 09:45 UTC](https://discourse.nodered.org/t/messages-looping-from-mysql-to-mqtt/11517/2 "2019-05-25T09:45:29Z")

</div>

Use an `rbe` node to avoid duplicate messages.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 May 2019 10:12 UTC](https://discourse.nodered.org/t/messages-looping-from-mysql-to-mqtt/11517/3 "2019-05-25T10:12:37Z")

</div>

Is it possible that the app keeps sending the data?

---

<div class="post-metadata">

**Author:** ![loadingaz](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@loadingaz](https://discourse.nodered.org/u/loadingaz)\
**Post date:** [25 May 2019 11:18 UTC](https://discourse.nodered.org/t/messages-looping-from-mysql-to-mqtt/11517/4 "2019-05-25T11:18:56Z")

</div>

RBE node did the job, thank you!

---

<div class="post-metadata">

**Author:** ![loadingaz](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@loadingaz](https://discourse.nodered.org/u/loadingaz)\
**Post date:** [25 May 2019 11:19 UTC](https://discourse.nodered.org/t/messages-looping-from-mysql-to-mqtt/11517/5 "2019-05-25T11:19:36Z")

</div>

I've made a button on the application to send data to mysql database, the data would be simple text "STOP" to MQTT Broker so it reads when to stop the alarm.
