August 17, 2023

cDelayer – Docs for ESB 5.x

cDelayer

cdelayer_icon32.png

cDelayer properties

Component Family

Processor

Function

The cDelayer component delays the
delivery of messages.

Purpose

The cDelayer component allows you
to set a latency in message routing.

Basic settings

Time to wait (in ms)

Fill this field with an integer (in milliseconds) to define the
time to wait before sending the message to the subsequent
endpoint.

Usage

This component is usually used in the middle of a Route.

Limitation

 n/a

Scenario: Using cDelayer to delay message routing

In this scenario, a cDelayer component is used to delay the
routing of each message to the target endpoint by 20 seconds.

use_case_cdelayer1.png

Dropping and linking the components

This use case requires one cDelayer component,
two cFile components, and two cProcessor components.

  1. From the Messaging folder of the
    Palette, drop two cFile components onto the design workspace, one to read
    files from a local folder and the other to write the files to another local
    folder.

  2. From the Processor folder of the
    Palette, drop two cProcessor components onto the design workspace, one next to
    the reading component to monitor messages read from the source file folder,
    and the other next to the writing component to monitor messages written to
    the target file folder.

  3. From the Processor folder of the Palette, drop one cDelayer
    component onto the design workspace, between the message reading monitor
    component and the message writing component.

  4. Connect the components using Row >
    Route connections.

  5. Label the components to better identify their roles in the Route, as shown
    above.

Configuring the components

  1. Double-click the first cFile component,
    which is labelled Read, to open its
    Basic settings view in the Component tab.

    use_case_cdelayer2.png
  2. In the Path field, enter or browse to the
    path to the source files, and leave the other parameters as they are.

  3. Repeat these steps to define the target folder in property settings of the second
    cFile component, which is labelled
    Write.

  4. Double-click the first cProcessor
    component, which is labelled Read_monitor, to open its Basics
    settings
    view in the Component tab.

    use_case_cdelayer4.png
  5. In the Code area, customize the code to display the time
    each message is read from the source:

  6. Repeat these steps to configure the second cProcessor
    component, which is labelled Write_monitor, to display the time each message is written
    to the target:

  7. Double-click the cDelayer component,
    which is labelled Delay_timer, to open
    its Basic settings view in the Component tab.

    use_case_cdelayer3.png
  8. In the Time to wait (in ms) field, enter
    the number of milliseconds by which you want to delay message delivery. Note
    that the value must be a positive integer.

    In this use case, we want each message to be delivered after a 20-second delay.

  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 have a look at the generated code.

    use_case_cdelayer6.png

    As shown in the code, a 20-second delay is implemented according to
    .delay(20000) in the message routing from the
    Read endpoint .to the Write
    endpoint.

  2. Press F6 to execute the Route.

    RESULT: Each message read from the source folder is routed to the target folder after a
    20-second delay.

    use_case_cdelayer7.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