# Using Inject node for MQTT Payload

**URL:** <https://discourse.nodered.org/t/using-inject-node-for-mqtt-payload/70217>\
**Category:** General\
**Created:** [7 November 2022 13:33 UTC](https://discourse.nodered.org/t/using-inject-node-for-mqtt-payload/70217 "2022-11-07T13:33:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![syedfarrukhqamar](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedfarrukhqamar/32/69739_2.png) [@syedfarrukhqamar](https://discourse.nodered.org/u/syedfarrukhqamar)\
**Post date:** [7 November 2022 13:33 UTC](https://discourse.nodered.org/t/using-inject-node-for-mqtt-payload/70217/1 "2022-11-07T13:33:22Z")

</div>

Goal: I want to inject mqtt payload after some intervals so I thought to use inject node.  
Issue: it is not working. I have added the MQTT topic in the topic field but I don't know how to get the payload  
can some one guide how to use inject node to push mqtt payload to furthest node

thanks in advance

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [7 November 2022 13:38 UTC](https://discourse.nodered.org/t/using-inject-node-for-mqtt-payload/70217/2 "2022-11-07T13:38:49Z")

</div>

MQTT uses a subscribe method, you don't get a topic manually, you subscribe to the topic and when it changes, the mqtt-in node used to subscribe will trigger a new message.

---

<div class="post-metadata">

**Author:** ![syedfarrukhqamar](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedfarrukhqamar/32/69739_2.png) [@syedfarrukhqamar](https://discourse.nodered.org/u/syedfarrukhqamar)\
**Post date:** [7 November 2022 13:40 UTC](https://discourse.nodered.org/t/using-inject-node-for-mqtt-payload/70217/3 "2022-11-07T13:40:38Z")

</div>

thanks for the prompt reply. the messages coming from the device are very frequent. I don't want to spam the db. so I want to insert them into the Db after some interval. so I thought to use the inject

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [7 November 2022 13:47 UTC](https://discourse.nodered.org/t/using-inject-node-for-mqtt-payload/70217/4 "2022-11-07T13:47:47Z")

</div>

As @TotallyInformation said, _MQTT uses a subscribe method_, so messages arrive at whatever rate the source device is publishing them. You could use a 'message-rate-limiter' (an option in the Delay node) so a message is only passed-on in the flow at a certain rate after a certain time.

 ![msg_rate_A](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d110551cc49c438ff08de7dbc6842b7ba9ca6b9a.png)

![msg_rate_B](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/76aefc8082e504d36a92a8beea576e037e597164.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 January 2023 13:48 UTC](https://discourse.nodered.org/t/using-inject-node-for-mqtt-payload/70217/5 "2023-01-06T13:48:46Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
