# Rate Limit per topic, releasing first message

**URL:** <https://discourse.nodered.org/t/rate-limit-per-topic-releasing-first-message/9669>\
**Category:** General\
**Created:** [1 April 2019 23:54 UTC](https://discourse.nodered.org/t/rate-limit-per-topic-releasing-first-message/9669 "2019-04-01T23:54:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcusone](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@marcusone](https://discourse.nodered.org/u/marcusone)\
**Post date:** [1 April 2019 23:54 UTC](https://discourse.nodered.org/t/rate-limit-per-topic-releasing-first-message/9669/1 "2019-04-01T23:54:12Z")

</div>

I have a need to rate limit a notification message, by topic. So I setup the delay node to do that. However, I want only 1 message per day per topic.  
Unfortunately, the Delay node will "delay" 1 day before sending the messages it has stored.

Is there a node that can send the first message of a topic, and delay any further messages on that topic for 1 (meaning rate limit, After, first received).

Thanks!

---

<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:** [2 April 2019 07:23 UTC](https://discourse.nodered.org/t/rate-limit-per-topic-releasing-first-message/9669/2 "2019-04-02T07:23:43Z")

</div>

The delay node can rate limit per topic.

---

<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:** [2 April 2019 07:52 UTC](https://discourse.nodered.org/t/rate-limit-per-topic-releasing-first-message/9669/3 "2019-04-02T07:52:45Z")

</div>

You are right that when the Delay node is in Rate Limit mode by topic it does not behave as it might be thought it should. One solution would be to split the messages by topic and use separate Delay nodes set to rate limit (ignoring topic) in each path. Messy but it should do the job.

---

<div class="post-metadata">

**Author:** ![marcusone](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@marcusone](https://discourse.nodered.org/u/marcusone)\
**Post date:** [3 April 2019 11:53 UTC](https://discourse.nodered.org/t/rate-limit-per-topic-releasing-first-message/9669/4 "2019-04-03T11:53:32Z")

</div>

Thanks, I've thought of all the "hacky" way to do it... I'll program my own node if I go that route and there isn't one already. So many great custom nodes out there I haven't found one yet and hoped someone here may know.  
I don't want to have to setup a new path every time I setup a new device that would use this flow (its a status check, which in theory, will get status' from any new device I add to my system and will only send notifications at the rate i want to limit.

---

<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:** [3 April 2019 12:37 UTC](https://discourse.nodered.org/t/rate-limit-per-topic-releasing-first-message/9669/5 "2019-04-03T12:37:44Z")

</div>

Can I just check that the underlying problem you have is not because there are repeated messages for a topic with the same contents. If that were the issue then you can use an RBE node to suppress them.

---

<div class="post-metadata">

**Author:** ![PiMo131](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pimo131/32/34978_2.png) [@PiMo131](https://discourse.nodered.org/u/PiMo131)\
**Post date:** [16 March 2022 09:19 UTC](https://discourse.nodered.org/t/rate-limit-per-topic-releasing-first-message/9669/6 "2022-03-16T09:19:41Z")

</div>

Marcus, dit you find a solution? i have the same problem
