Skip to main content
Version: 4.15.0

Throttling component

The Throttling component is used to throttle messages, it lets a maximum amount of messages pass through to the next component per time period. It's often used to ensure that a specific endpoint does not get overloaded with requests.

Configuration

The Throttling component has the following basic configuration options:

Time period

The time period for which the Max requests count is valid for, in milliseconds.

Max requests

The amount of messages passed through to the next component for each Time period.

Using Throttling

The Throttling component in the image below has its Time period set to 10000 and Max requests to 5.

Throttle example

In this example all messages coming from the Inbound HTTP component will be throttled and every 10 seconds a maximum of 5 messages are passed on to the Email component.

note

Whenever the Throttling component passes multiple messages at once they still follow their own seperate route.

null body

The Throttling component will halt on messages with a null body.

Throttling and Split

When using a Throttling component in the bottom route of a Split component splitted messages are passed through consecutively. The amount of messages passed is equal to Max requests and the time between passing (a set of) messages is equal to the Time period.

The Throttling component in the image below has its Time period set to 10000 and Max requests to 1.

Throttle in combination with Split example

The Velocity component contains the XML shown below and the Split component uses xPath to split the XML on the product element. This spits the XML into three <product>n</product> messages.

Example XML body
<products>
<product>1</product>
<product>2</product>
<product>3</product>
</products>

Whenever the Scheduler component triggers, the:

  • 1st message passes after 10 seconds.
  • 2nd message passes 10 seconds after the 1st one.
  • 3rd message passes 10 seconds after the 2nd one.

Setting the Max requests to 2, when the Scheduler component triggers, the:

  • 1st and 2nd message are passed after 10 seconds.
  • 3rd message passes 10 seconds after the 1st and 2nd one.