August 15, 2023

cConfig – Docs for ESB 6.x

cConfig

Sets the CamelContext using Java code.

cConfig Standard properties

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

The Standard
cConfig component belongs to the Custom family.

Basic settings

Imports

Enter the Java code that helps to import, if necessary, external
libraries used in the Code
box.

Code

Write a piece of code to manipulate the CamelContext.

Dependencies

Click [+] to add the library or libraries that are
required by the CamelContext or Typeconverter Registry to the Studio.

Click […] in the Lib Path field
to show the Select Module dialog box. Select the inner
module from the list or browse to the external module of your choice and click
OK to close the dialog box.

The version of the external
module is extracted, If not, a default Snapshot version
0.0.1-SNAPSHOT is given to the library. You can change it
as needed. If you are connected to a remote project with Talend Studio, when saving the
Route, the external libraries will be uploaded to the Talend Artifact Repository configured in the Talend Administration Center. The libraries
with the -SNAPSHOT suffix in the version number will be
published to the Snapshot repository. Otherwise it will be published to the
Release repository. If you change the version of the library and save the
Route, a new version of the library will be uploaded to the Talend Artifact Repository.

For more information about
how to install Talend Artifact Repository, see Talend Installation
Guide. For how to set the Artifact repository connection preferences, see
Talend Administration Center User
Guide. For how to connect to a remote project, see Talend Studio User Guide.

Advanced settings

Use MDC Logging

Select this check box to enable the use of MDC logging.

To be able to use this option, you need to open the Log4j view in the [Project
Settings]
dialog box by clicking File > Edit Project
Properties
on the toolbar of the Studio main window. Select the
Activate log4j in components check box
to activate the log4j feature. Then change the ConversionPattern in the log4j template to add your custom MDC
property like %X{mdcPropertyName}.

To show the MDC information in the log, use the cLog component and a cProcessor before and after the cLog. In the cProcessor
before the cLog, enter the code org.apache.log4j.MDC.put("Key", "Value"); to add the
custom property. In the cProcessor after
the cLog, enter the code org.apache.log4j.MDC.remove("Key"); to remove the MDC
property.

For information on how to activate log4j in components and how to
customize log4j configuration, see
Talend Studio User Guide

For more information about MDC logging, see the website http://camel.apache.org/mdc-logging.html.

For more information about the cLog component, see cLog.

Check

Click this button to check the version of the libraries that are added to the
Route in the Talend Artifact Repository. The libraries are listed in the table below, with
the versions shown in the Update To column. If the
version of the local library is the same as in the Talend Artifact Repository, a is shown in the
Status column. If the version of the local library is
older than in the Talend Artifact Repository, a × is shown in the
Status column, and the check box in the
Sync column is selected by default.

Sync

Select the check box in the Sync column of the table for
the libraries that you want to update and click the Sync
button to download and install the newer version from the Talend Artifact Repository into the Studio.

Usage

Usage rule

cConfig cannot be added directly
in a Route.

Limitation

 n/a

Scenario: Implementing a dataset from the Registry

This scenario applies only to a Talend solution with ESB.

In this scenario, an instance of dataset is added in the Registry and implemented by a
cMessagingEndpoint component.

use_case_cconfig1.png

Dropping and linking the components

  1. From the Palette, expand the Custom folder, and drop a cConfig component onto the design workspace.
  2. Expand the Connectivity folder, and drop a cMessagingEndpoint component onto the design
    workspace.
  3. Expand the Custom folder, and drop a cProcessor component onto the design
    workspace.
  4. Right-click the input cMessagingEndpoint
    component, select Row > Route from the contextual menu and click the
    cProcessor component.
  5. Label the components to better identify their functionality.

Configuring the components

  1. Double-click the cConfig component, which
    is labelled Create_dataset, to display
    its Basic settings view in the Component tab. and set its parameters.

    use_case_cconfig4.png

  2. Write a piece of code in the Code field
    to register the dataset instance foo into
    the registry, as shown below.

  3. Double-click the input cMessagingEndpoint
    component, which is labelled Read_dataset, to display its Basic
    settings
    view in the Component tab.

    use_case_cconfig2.png

  4. In the URI field, enter
    dataset:foo between the quotation marks.
  5. Double-click the cProcessor component,
    which is labelled Monitor, to display its
    Basic settings view in the Component tab.

    use_case_cconfig3.png
  6. In the Code box, customize the code as
    follows so that the Run console displays
    the message contents:

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

    use_case_cconfig5.png
    As shown in the code, a message route is built from the
    endpoint identified byRead_dataset and
    cProcessor_1 gets the message content and displays it on
    the console.
  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 content is printed in the console.
    use_case_cconfig6.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