Skip to content

Tutorial Talend Component Kit 1: Setting Up the Development Environment

Simon Neidig edited this page Dec 11, 2019 · 1 revision

With version 7.1 of "Talend Open Studio for Data Integration" (TOS DI), the development of custom components was switched from Java Jet to the Talend Component Kit and Java. In this tutorial series you will learn how to create a Jira Custom Component using the Talend Component Kit.

After the first part you can:

  • Creating a project with Intellij Plugin
  • build your own component with just one click and execute it in TOS DI
  • Integrate external picture libraries

1. Talend Open Studio for Data Integration and Install Intellij IDEA

First of all, all required programs should be installed on the computer. If not already installed, "Talend Open Studio for Data Integration " and "Intellij IDEA " must be installed. The version available free of charge is sufficient.

In this tutorial series the versions TOSDI 7.1.1 and Intellij IDEA Community 2019.2 are used.

The downloads can be found under the following links:

2. Install Talend Custom Component Intellij Plugin

A new Talend Component Kit project can be created via the Talend website. Alternatively the Talend Component Kit Plugin for Intellij IDEA will be provided. This will allow the creation of a project directly in the IDE and thus makes it much more pleasant.

For the installation the tab "Intellij IDEA→Preferences " must be selected in Intellij. In the section "Plugins " (see fig. 1) you can search for "Talend Component Kit " and install the corresponding plugin.

3. Create project with Intellij Plugin

Abb. 2: Erstellung eines neuen Talend Component Kit Projekts

The previously installed plugin makes it very easy to generate a new Talend Component Kit project. To do this, select "File→New→Project " as shown in Fig. 2 "Talend Component ". Abb. 3: Konfiguration der Komponente{.wp-image-6327}

In the next step, the plugin allows you to configure the project. For example, the Build Tool, the name of the component family and the category in which the components later appear in the TOS DI can be selected.

For this tutorial series we choose "Maven " as the build tool. Furthermore, an input and an output component should be generated by selecting "Activate IO ".

Abb. 4: Einbindung externer Libraries, Testumgebungen und CI Tools{.wp-image-6321}

The selection "Select a facet to add to your project " circled in red is an important possibility. Some selected external libraries can already be integrated and configured automatically. Recommended and required for the Jira component created in the next parts of the tutorial are "Apache Beam " and "Talend Component Kit Testing ". In order to have more freedom later regarding CI integration, "Travis CI" should also be selected.

With a click on Next and Finish we finish the project creation. The newly created project should now open automatically.

4. include build commands as shortcuts

Before you can start programming, you must set up the building of the project. By default, only the creation of a build via the command line is supported . However, there is a workaround for this.

Abb. 5: Anlegen einer neuen Konfiguration

In general, the two commands are required for a "Clean Install " and an installation in Talend Open Studio. A new configuration must first be created for both configurations. Select "Edit Configurations... " in the upper right corner of the IDE and create a new "Shell Script " with the "+" in the opening window, as shown in Fig. 5.

4.1 Maven Clean Install

In addition to the "Name ", "Script Path " and "Script Options " must be configured. At the path of the script you have to select Mac OS and Linux, the file "mvnw " in the project folder, at Windows the file "mvnw.cmd".

The script option for a clean build of the project, as shown in Figure 6, is "clean install ".

Abb. 6: Erstellen einer Maven Clean Install Konfiguration

4.2 Deploy to Talend Open Studio

A second configuration is interesting in order to be able to integrate the created component directly into a job in Talend Open Studio for Data Integration and thus test it. To do this, first select the "mvnw " file as in 4.1 and then add the Script option.

Abb. 7: Erstellen einer Deploy to Talend Open Studio Konfiguration{.wp-image-6324}

The following must be inserted in Script options:

  • talend-component:deploy-in-studio -Dtalend.component.studioHome="/PathToTOSDI/TOSDI-7.1.1/studio"".

"PathToTOSDI " serves as placeholder for the path where your Talend is installed on your computer.

4.2.1 Updating and removing an installed component from TOS DI

Before you waste hours looking for ways to remove a component from TOS DI or make a newer build available in TOS DI, here is a brief explanation.

In the folder where TOSDI is installed (which in 4.2 was also specified as PathToTOSDI/TOSDI-7.1.1/studio), there is another folder "configuration " and in it a file "components-registration.properties ". To update a component, remove the component's entry from this file and then run the previously created "TOSDI Build " shortcut. To remove a component only the entry has to be deleted.

5. Integration of external libraries

To be able to use the functionality of external libraries, they must be integrated into the project via Maven. The project folder contains a "pom.xml " file in which a new entry in the "<dependencies>" tag must be added for each additional library.

In this tutorial the two libraries "Unirest " and "JsonPath " are used and are included as follows.

<dependency>
    <groupId>com.mashape.unirest</groupId>
    <artifactId>unirest-java</artifactId>
    <version>1.4.9</version>
</dependency>
<dependency>
    <groupId>com.jayway.jsonpath</groupId>
    <artifactId>json-path</artifactId>
    <version>2.4.0</version>
</dependency>

This code snippet must be placed within the "<dependencies>" tag as mentioned above. For other libraries you can usually find the snippet at the beginning of the documentation.

6. Further tutorials

In the next tutorial the test environment will be set up. The following tutorials can be found here: