August 17, 2023

cDataset – Docs for ESB 5.x

cDataset

cdataset_icon32_white.png

cDataset properties

Component Family

Messaging

Function

The cDataset component allows you to create a new
dataset or reference an existing dataset to send or receive
messages.

Purpose

The cDataset component provides a mechanism to easily
perform load and soak testing of your system. It works by allowing
you to create dataset instances both as a source of messages and as
a way to assert that the data set is received.

Basic settings

Id

The ID of the Dataset bean.

  Produce Delay Specify a delay in milliseconds to cause producers to pause.
  Consume Delay Specify a delay in milliseconds to cause consumers to pause.
  Preload Size Specify how many messages should be sent before the Route completes its
initialization.
  Initial Delay Specify the time in milliseconds to wait before starting sending messages.
  Minimum Rate Specify the least number of messages that the dataset should contain
before starting sending messages.
  Register new Bean Select this check box to register a new bean.
  Bean Class Enter the class of the bean. This field appears when the
Register new Bean check box is
selected.
  Arguments Set the optional arguments in the corresponding table.
Click [+] as many times as required to
add arguments to the table. This table appears when the Register new Bean check box is
selected.

Usage

cDataset can be a start, middle, or end component of a
Route.

Limitation

 n/a

Scenario: Using cDataset to receive messages

In this scenario, a cDataset component is used to receive
messages triggered by a cTimer.

use_case_cdataset1.png

Dropping and linking the components

  1. From the Messaging folder of the Palette, drag and drop a cTimer and a cDataset
    component onto the design workspace.

  2. From the Transformation folder, drag and drop a
    cSetBody component onto the design
    workspace.

  3. From the Processor folder, drag and drop one cProcessor component onto the design
    workspace.

  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 cTimer component, which is
    labelled Starter, to open its Basic settings view in the Component tab.

    use_case_cdataset2.png
  2. In the Repeat field, enter 2 to generate
    the message exchange twice. Keep the default settings of the other options.

  3. Double-click the cSetBody component,
    which is labelled Set_message_body, to
    open its Basic settings view in the
    Component tab.

    use_case_cdataset3.png
  4. Select Constant in the Language list and enter "Hello!" in
    the Expression field as the message
    body.

  5. Double-click the cDataset component, which is labelled
    Receive_message, to open its
    Basic settings view in the Component tab.

    use_case_cdataset4.png
  6. In the Id field, enter "myDataset" as the
    dataset bean ID. Keep the default settings of the other options.

    In the Bean Class field, the default implementation that
    is shipped by Camel
    org.apache.camel.component.dataset.SimpleDataSet is set. In
    this use case, a new dataset bean is registered.

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

    use_case_cdataset5.png
  8. In the Code area, customize the code to show the body of
    the message exchanges.

  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_cdataset6.png

    As shown in the code, the Route is built from the
    Starter_cTimer_1 endpoint, set the message body as
    "Hello!" by cSetBody_1, routed
    .to
    cDataset_1, and then processed by
    cProcessor_1.

  2. Press F6 to execute the Route.

    RESULT: The message body is displayed twice in the execution console.

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