Hi,
So I want to rate limit the amount of output messages, by topics.
I have a node that fires messages with different msg.topics and msg.payload, which is exemplified with inject nodes in the photo.
The idea is:
- There will be messages for multiple topics being created every 30 seconds.
- For each topic, no more than 1 message should flow for the specified rate limit. However, all messages for other topics should flow normally (if the first in the limit specified, counted by topic).
In the example, if inject a message from topic1 and topic2 at the same time, I would expect them to flow through since it's the first time they appear. However, they are being queued for 15 secs. Why is that? Shouldn't it start right away?
It looks like the node is only available after 15 seconds, the rate limit time
Thanks!
[{"id":"802deb2b30bb1599","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"5b3fbbaa5a4caca5","type":"inject","z":"802deb2b30bb1599","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic1","payload":"a","payloadType":"str","x":220,"y":180,"wires":[["07ff0366f2330fcc"]]},{"id":"8706ae1254fec722","type":"inject","z":"802deb2b30bb1599","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic1","payload":"b","payloadType":"str","x":226,"y":232,"wires":[["07ff0366f2330fcc"]]},{"id":"fd4457480abf88b6","type":"inject","z":"802deb2b30bb1599","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic2","payload":"c","payloadType":"str","x":226,"y":312,"wires":[["07ff0366f2330fcc"]]},{"id":"af5f1a9ead9367af","type":"inject","z":"802deb2b30bb1599","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic2","payload":"d","payloadType":"str","x":232,"y":364,"wires":[["07ff0366f2330fcc"]]},{"id":"60193aff98e25bab","type":"debug","z":"802deb2b30bb1599","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":700,"y":300,"wires":[]},{"id":"07ff0366f2330fcc","type":"delay","z":"802deb2b30bb1599","name":"","pauseType":"queue","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"15","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":480,"y":260,"wires":[["60193aff98e25bab"]]}]