July 30, 2023

cThrottler – Docs for ESB ESB 7.x

cThrottler

Limits the number of messages flowing to a specific endpoint in order to prevent
it from getting overloaded.

cThrottler Standard properties

These properties are used to configure cThrottler running in the Standard Job framework.

The Standard
cThrottler component belongs to the Routing family.

Basic settings

Request per period

The number of messages allowed to pass cThrottler within the defined time period.

Set time period

Select this check box to set the value of the time period (in
milliseconds) and enable throttling.

Use asynchronous delaying

If this check box is selected, any messages that are delayed will
be routed asynchronously using a scheduled thread pool.

Usage

Usage rule

Being a middle component, cThrottler allows you to limit the number of
messages flowing to a specific endpoint in order to prevent it from
getting overloaded.

Connections throttler: Select this link to route
the throttled messages to the next endpoint.
Route: Select this link to route all the messages
from the sender to the next endpoint.

Limitation

 n/a

Throttling the message flow

This scenario applies only to Talend Open Studio for ESB, Talend Data Services Platform and Talend Data Fabric.

In this scenario, a cThrottler component is used to
reduce the number of messages flowing out within a time period.

cThrottler_1.png

To build the Route, do the following.

Dropping and linking the components

  1. Drag and drop the components from the Palette onto the workspace: cThrottler, cFile and two
    cProcessor. Change the label of the
    cFile component to Read_Output. Change the labels of the two
    cProcessor components to Print_File_Name and Print_File_Content.
  2. Link Read_Output to cThrottler using a Row >
    Route connection.
  3. Link cThrottler to Print_File_Name using a Row
    > Throttler connection, and to Print_File_Content using a Row > Route
    connection.

Configuring the components

  1. Double-click Read_Output to open its
    Basic settings view in the Component tab.

    cThrottler_2.png

  2. In the Path field, type in the path to
    the source message, for example, “E:/data/output”. Keep the default settings for other
    fields.
  3. Double-click cThrottler to open its
    Basic settings view in the Component tab.

    cThrottler_3.png

  4. In the Request per period field, type in
    the number of messages allowed to pass the throttler per period, for
    example, 1.

    In the Set time period field, type in the
    value of the period, for example, 8000.
  5. Double-click Print_File_Name to open its
    Basic settings view in the Component tab.

    cThrottler_4.png

  6. In the Code box, enter the code below to
    get the name of the message that passes the throttler.

  7. Double-click Print_File_Content to open
    its Basic settings view in the Component tab.

    cThrottler_5.png

  8. In the Code box, enter the code below to
    get the content of the message that passes the throttler.

  9. Press Ctrl+S to save your Route.

Viewing the code and executing the Route

  1. Click the Code tab at the bottom of the
    design workspace to check the generated code.

    cThrottler_6.png

    As shown above, the messages from Read_Output go through
    throttling at cThrottler_1, with only (1) message
    allowed to leave the throttler within each timePeriodMillis(8000).
    Meanwhile, the filename and the content of the throttled message are printed out
    via the two processors.
  2. Press F6 to execute the Route.

    As shown below, File_A.txt was delivered
    within the first time period while in the second period, File_B.txt was delivered as well.
    cThrottler_7.png


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x