Previously, I introduced how to use a custom component for processing that cannot be achieved by a standard component, but this time I will show you how to create a component.
Prior to version 6 of Talend, Talend Studio came with a feature called Component Designer, which allowed you to create components. However, in version 7 and later, Component Designer has been abolished and changed to the method of developing in a Java integrated development environment such as Eclipse and IntelliJ.
Talend Component Kit is required for component development, so use IntelliJ with plugins available. Start IntelliJ, create an empty project, open the setting screen from the file in the menu, enter Talend from the search tab of the plugin marketplace, Talend Component Kit will be displayed, select this and install it And restart IntelliJ. Java JDK 1.8.x is required for Java.
From the Welcome to IntelliJ IDEA screen, click New Project, select Talend Component Kit and click Next. The Talend STARTER TOOLKIT shown below is displayed.
The Talend STARTER TOOLKIT screen defines component and project metadata. This time, set the contents shown in the figure below. Enter each item and click ③ Add A Component on the left side of the screen to display the Configuration screen.
On the Configration screen, set the component name and input / output settings. This time, change only the name to Logger as shown in the figure below, and input / output is done with the default settings. Click Next to display the project name and save location setting screen shown below. Change it if necessary and click the Finish button.
When the STARTER TOOLKIT is completed, you will be taken to the IntelliJ project screen. At this point, the minimum settings required to create the component are complete. When you open LoggerProcessor.java from your project, the code base needed to create the component is already created.
At this point, it's a component that doesn't work at all, but I'll try deploying it to Talend OpenStudio. In the IntelliJ terminal, type mvnw clear install to compile. The compilation is executed as shown in the figure below and ends normally. Then enter mvnw talend-component: deploy-in-studio -Dtalend.component.studioHome = "C: \ Talend \ 7.1.1_TOS_DI" to deploy to Talend OpenStudio. For the path enclosed in double quotes, set the path to the home of Talend OpenStudio that uses the component you are deploying. Deployment is executed as shown in the figure below and ends normally.
Start Talend OpenStudio specified as the deployment destination and create an empty job. When you open the Palette Misc, the SampleFamily defined in the STARTER TOOLKIT metadata is displayed, and the deployed component SampleFamilyLogger is available. Make sure that you can place it in the job and use it.
Since it is a component that does not have any visual result even if it is executed as it is, change it to a component that displays the input contents. Exit TalendOpenStudio, go back to IntelliJ, open LoggerProcessor.java, look for @ElementListener and add the following two lines. //Log to the console System.out.println("Input["+defaultInput+"]"); Compile and deploy from the terminal as before. Start Talend OpenStudio again, open the previous job, add tFileInputDelimitede to the Input side of the component, and execute the job. The input contents from the file will be displayed in the execution result.
By using IntelliJ and Talend Component Kit, I was able to easily create a component base. Next time, I would like to dig a little deeper and create a component.
Recommended Posts