July 30, 2023

cSEDA – Docs for ESB ESB 7.x


Produces and consumes messages asynchronously in different threads within a single

cSEDA provides asynchronous SEDA
behavior, so that messages are exchanged on a BlockingQueue and
consumers are invoked in a separate thread from the producer within
a single CamelContext.

cSEDA Standard properties

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

The Standard
cSEDA component belongs to the Core family.

Basic settings

When using as a start component
in a Route:


Type in any string that uniquely identifies the endpoint.

Specify maximum capacity size Select this check box to set the maximum number of
messages that the SEDA queue can hold. Specify the number in the
Size field.

Specify the number of concurrent threads processing exchanges.

Wait for task to

Specify whether the caller should wait for the asynchronous task
to complete or not before continuing. Select from Always, Never or IfReplyExpected. The default option is IfReplyExpected which means the caller
will only wait if the message is Request-Reply based. For more
information about this option, see the site http://camel.apache.org/async.html.

Timeout Specify the time in milliseconds before a SEDA producer
will stop waiting for an asynchronous task to complete. You can disable
this option by using 0 or a negative value.
Use multiple
Specifies whether multiple consumers are allowed. If
enabled, you can use cSEDA for
Publish-Subscribe messaging, which means you can send a message to the
SEDA queue and have each consumer receive a copy of the message. When
enabled, this option should be specified on every consumer endpoint.
Limit concurrent
Whether to limit the number of concurrent consumers to
the maximum of 500. By default, an exception will be thrown if a SEDA
endpoint is configured with a greater number.
Block when
Whether a thread that sends messages to a full SEDA
queue will block until the queue’s capacity is no longer exhausted. By
default, an exception will be thrown stating that the queue is full. By
enabling this option, the calling thread will block instead and wait
until the message can be accepted.
Poll timeout Specify the timeout in milliseconds used when polling.
When a timeout occurs, the consumer can check whether it is allowed to
continue running. Setting a low value allows the consumer to react more
quickly upon shutdown.
When using as a middle or end
component in a Route:
Use Exist
Click […] and select
the corresponding consumer in the dialog box.

Advanced settings

Arguments This option is available only when cSEDA is used as a start component in the Route. Set the
optional arguments in the corresponding table. Click [+] as many times as required to add
arguments to the table. Then click the corresponding Value field and enter a value. See the site
http://camel.apache.org/seda.html for available


Usage rule

cSEDA is used as a start, middle,
or end component in a Route.



Using cSEDA, cVM and cDirect to produce and consume messages

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

In this scenario, we will use a cTimer component to
trigger a message exchange. The message is routed to a cSEDA, a cVM and a cDirect sequentially with a message body set for each of
them, which is then consumed in another thread.

We will create a Route Resource to define the repeat count of the message exchange
(the number of times the message should be sent), which will be used by the cTimer component.

Creating a Route Resource and calling it in the Route

  1. From the repository tree view, right-click the Resources node and select Create
    from the context menu.


  2. The New Route Resource wizard
    opens. In the Name field, type in a
    name for the Resource, for example, SetRepeatCount.
    Click Finish to close the


  3. Enter repeat.count=2 in the design workspace to set the
    repeat count.


  4. Press Ctrl+S to save your Route
  5. Right-click the Route from the repository tree view and select
    Manage Route Resources from the
    context menu.


    The Manage Route Resources wizard
    is opened.

  6. Click Add and select
    SetRepeatCount from the Resources tree view in
    the dialog. Click OK.


    The SetRepeatCount Route Resource is added in the

  7. Click OK to close the wizard.

    For more information about creating and using Route Resources, see

    Talend Studio User Guide
  8. Click the Spring tab on the lower
    half of the design workspace of the Route.


  9. Enter the following code in this view to call the Route Resource you
    just created.

    For more information about using Spring configuration in a Route, see

    Talend Studio User Guide

Dropping and linking the components


  1. From the Palette, drag and drop a
    cTimer, two cSEDA, two cVM, two
    cDirect, three cSetbody, and three cLog
    components onto the design workspace.
  2. Link the components using the Row >
    Route connection as shown above.
  3. Label the components to better identify their roles in the Route.

Configuring the components and connections

  1. Double-click Starter in the design
    workspace to display its Basic settings
    view in the Component tab.


  2. In the Repeat field, enter
    "{{repeat.count}}" that is defined in the Route
  3. Double-click Set_body_SEDA in the
    design workspace to display its Basic
    view in the Component tab.


  4. Select SIMPLE in the Language list.

    In Expression field, enter the "to
    as the message body.
    Repeat this step to set the message body in Set_body_VM and Set_body_Direct as "to cVM" and "to


  5. Double-click SEDA_producer to display
    its Basic settings view in the Component tab.


  6. Click […] and select SEDA_consumer in the Select a Node: wizard, which will consume the message that
    is sent to SEDA_producer.


    Repeat this step to select the node VM_consumer for VM_producer.

    Select the node Direct_consumer for

  7. Double-click SEDA_consumer to display
    its Basic settings view in the Component tab.


  8. In the Name field, type in
    "seda" to identify this endpoint. Keep the default settings
    of the other options.

    Repeat this step to give the name "vm" to VM_consumer.

    Give the name "direct" to Direct_consumer.

  9. Double-click Monitor_SEDA to display
    its Basic settings view in the Component tab.


  10. Select INFO in the Level list and select Specify output
    log message
    . In the Message
    field, enter "log cSEDA:${body}" to print the message body in
    the console.

    Repeat this step to specify the output message for Monitor_VM and Monitor_Direct as "log cVM:${body}" and
    "log cDirect:${body}" respectively.
  11. Press Ctrl+S to save your Route.

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


    As shown in the code, a message route is built from
    "Starter_cTimer_1", set the message body "to
    by "cSetBody_1", and sent to
    cSEDA_2, which is mapped to
    "SEDA_consumer_cSEDA_1". The message is then sent to
    cVM_2, cDirect_2 sequentially which is mapped
    to its corresponding consumer with a new message body. On the consumer side,
    the message body from each consumer is logged by the
    corresponding monitor.
  2. Click the Run view to display it and
    click the Run button to launch the
    execution of your Route. You can also press F6 to execute it.


    RESULT: The message that is sent to SEDA_producer, VM_producer, and Direct_producer is consumed by SEDA_consumer, VM_consumer, and Direct_consumer respectively. The message exchange is
    triggered twice as set in the Route Resource

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