cConfig
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 |
Code |
Write a piece of code to manipulate the CamelContext. |
Dependencies |
Click [+] to add the library or libraries that are Click […] in the Lib Path field The version of the external For more information about |
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 To show the MDC information in the log, use the cLog component and a cProcessor before and after the cLog. In the cProcessor For information on how to activate log4j in components and how to 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 |
Sync |
Select the check box in the Sync column of the table for |
Usage
Usage rule |
cConfig cannot be added directly |
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.
Dropping and linking the components
- From the Palette, expand the Custom folder, and drop a cConfig component onto the design workspace.
-
Expand the Connectivity folder, and drop a cMessagingEndpoint component onto the design
workspace. -
Expand the Custom folder, and drop a cProcessor component onto the design
workspace. -
Right-click the input cMessagingEndpoint
component, select Row > Route from the contextual menu and click the
cProcessor component. - Label the components to better identify their functionality.
Configuring the components
-
Double-click the cConfig component, which
is labelled Create_dataset, to display
its Basic settings view in the Component tab. and set its parameters. -
Write a piece of code in the Code field
to register the dataset instance foo into
the registry, as shown below.1234SimpleDataSet dataset = new SimpleDataSet(1);String messageBody = "testbody";dataset.setDefaultBody(messageBody);registry.put("foo", dataset); -
Double-click the input cMessagingEndpoint
component, which is labelled Read_dataset, to display its Basic
settings view in the Component tab. -
In the URI field, enter
dataset:foo between the quotation marks. -
Double-click the cProcessor component,
which is labelled Monitor, to display its
Basic settings view in the Component tab.
-
In the Code box, customize the code as
follows so that the Run console displays
the message contents:12System.out.println("Message content: "+exchange.getIn().toString()); - Press Ctrl+S to save your route.
Viewing code and executing the Route
-
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 builtfrom
the
endpoint identified byRead_dataset
and
cProcessor_1
gets the message content and displays it on
the console. -
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.