2018-11-30 13:50:49 +01:00
|
|
|
<!--
|
|
|
|
Copyright JS Foundation and other contributors, http://js.foundation
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
2020-01-15 03:40:48 +01:00
|
|
|
<script type="text/html" data-help-name="delay">
|
2018-11-30 13:50:49 +01:00
|
|
|
<p>Delays each message passing through the node or limits the rate at which they can pass.</p>
|
|
|
|
<h3>Inputs</h3>
|
|
|
|
<dl class="message-properties">
|
|
|
|
<dt class="optional">delay <span class="property-type">number</span></dt>
|
|
|
|
<dd>Sets the delay, in milliseconds, to be applied to the message. This
|
|
|
|
option only applies if the node is configured to allow the message to
|
|
|
|
override the configured default delay interval.</dd>
|
2021-04-22 10:01:28 +02:00
|
|
|
<dt class="optional">rate <span class="property-type">number</span></dt>
|
|
|
|
<dd>Sets the rate value in milliseconds between messages.
|
|
|
|
This node overwrites the existing rate value defined in the node configuration
|
2021-04-22 12:02:34 +02:00
|
|
|
when it receives the message which contains <code>msg.rate</code> value in milliSeconds.
|
|
|
|
This option only applies if the node is configured to allow the message to
|
|
|
|
override the configured default rate interval.</dd>
|
2019-08-01 13:50:35 +02:00
|
|
|
<dt class="optional">reset</dt>
|
|
|
|
<dd>If the received message has this property set to any value, all
|
|
|
|
outstanding messages held by the node are cleared without being sent.</dd>
|
|
|
|
<dt class="optional">flush</dt>
|
2021-07-08 13:13:23 +02:00
|
|
|
<dd>If the received message has this property set to a numeric value then that many messages
|
|
|
|
will be released immediately. If set to any other type (e.g. boolean), then all
|
2019-08-01 13:50:35 +02:00
|
|
|
outstanding messages held by the node are sent immediately.</dd>
|
2021-07-16 12:31:21 +02:00
|
|
|
<dt class="optional">toFront</dt>
|
|
|
|
<dd>When in rate limit mode, if the received message has this property set to boolean <code>true</code>,
|
|
|
|
then the message is pushed to the front of the queue and will be released next.
|
|
|
|
This can be used in combination with <code>msg.flush=1</code> to resend immediately.
|
|
|
|
</dd>
|
2018-11-30 13:50:49 +01:00
|
|
|
</dl>
|
|
|
|
<h3>Details</h3>
|
|
|
|
<p>When configured to delay messages, the delay interval can be a fixed value,
|
2020-07-06 11:33:26 +02:00
|
|
|
a random value within a range or dynamically set for each message.
|
2021-04-22 12:02:34 +02:00
|
|
|
Each message is delayed independently of any other message, based on
|
2020-07-06 11:33:26 +02:00
|
|
|
the time of its arrival.
|
|
|
|
</p>
|
2018-11-30 13:50:49 +01:00
|
|
|
<p>When configured to rate limit messages, their delivery is spread across
|
2020-07-06 11:33:26 +02:00
|
|
|
the configured time period. The status shows the number of messages currently in the queue.
|
|
|
|
It can optionally discard intermediate messages as they arrive.</p>
|
2018-11-30 13:50:49 +01:00
|
|
|
</p>
|
2021-08-18 15:05:42 +02:00
|
|
|
<p>If set to allow override of the rate, the new rate will be applied immediately,
|
2021-04-22 12:02:34 +02:00
|
|
|
and will remain in effect until changed again, the node is reset, or the flow is restarted.</p>
|
2018-11-30 13:50:49 +01:00
|
|
|
<p>The rate limiting can be applied to all messages, or group them according to
|
2021-04-22 12:02:34 +02:00
|
|
|
their <code>msg.topic</code> value. When grouping, intermediate messages are
|
2020-07-06 11:33:26 +02:00
|
|
|
automatically dropped. At each time interval, the node can either release
|
|
|
|
the most recent message for all topics, or release the most recent message
|
|
|
|
for the next topic.
|
2018-11-30 13:50:49 +01:00
|
|
|
</p>
|
2021-08-18 15:05:42 +02:00
|
|
|
<p><b>Note</b>: In rate limit mode the maximum queue depth can be set by a property in your
|
2022-01-07 18:43:53 +01:00
|
|
|
<i>settings.js</i> file. For example <code>nodeMessageBufferMaxLength: 1000,</code></p>
|
2018-11-30 13:50:49 +01:00
|
|
|
</script>
|