Configuring a Job using a tJava component - 7.3

Java custom code

Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Talend Studio
Data Governance > Third-party systems > Custom code components (Integration) > Java custom code components
Data Quality and Preparation > Third-party systems > Custom code components (Integration) > Java custom code components
Design and Development > Third-party systems > Custom code components (Integration) > Java custom code components
Last publication date

A common Job using tJava is generally composed of:

  • a tFileInputDelimited component to read data from a text file,
  • a tLogRow component to print data in the console,
  • a tJava component to retrieve the total number of records processed.


  1. In the Palette, drag and drop a tFileInputDelimited , a tLogRow and a tJava component onto the workspace.
  2. Connect tFileInputDelimited to tJava using a Trigger > OnSubjobOk link.
  3. Set the Basic settings of the tFileInputDelimited component.
  4. Double-click on tFileInputDelimited to display its Basic settings. In the file name/steam field, add the source data file path "C:/person.txt".
  5. This file includes the following data:
  6. Click the Edit Schema button and set the two-column schema.
  7. Double-click on tjava to display its Basic settings view and add the following code in the Code area:
    int nb_line=(Integer)globalMap.get("tFileInputDelimited_1_NB_LINE");
    System.out.println("The total number of records are read from the text file is: " +nb_line);
  8. Execute the Job by pressing F6.


The actual records from the input file are printed into the console natively. In addition, due to the use of the tJava component, the number of records also displays onto the console.