Configuring the Job for redirecting the standard output to a file - 7.3

Java custom code

Version
7.3
Language
English
Product
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
Module
Talend Studio
Content
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

Procedure

  1. Double-click the tJava component and in the Code field on its Basic settings view, enter the following code:
    java.io.File file = new java.io.File("d:/mytalend.log");
    java.io.PrintStream log_java = new java.io.PrintStream(new java.io.FileOutputStream(file));
    System.setOut(log_java);

    The standard output of the entire Job will be redirected to the file d:/mytalend.log.

  2. Double-click the first tFixedFlowInput component to open its Basic settings view.
  3. Click the […] button next to Edit schema and in the dialog box displayed, define the schema by adding three columns: id of Integer type, name and team of String type.
  4. In the Mode area, select Use Inline Content (delimited file) and in the Content field, enter the following input data for the first tFixedFlowInput component:
    1;Lily;QA
    2;Kevin;DEV
    3;Daniel;DEV
  5. Double-click the tFileOutputDelimited component and on its Basic settings view, select the Use Output Stream check box and enter System.out in the Output Stream field.
  6. Click the Sync columns button to retrieve the schema from the previous component.
  7. Double-click the second tFixedFlowInput component to open its Basic settings view.
  8. Define the schema by adding three columns, same as the first tFixedFlowInput component.
  9. In the Mode area, select Use Inline Content (delimited file) and in the Content field, enter the following input data for the second tFixedFlowInput component:
    4;Allen;DOC
    5;Judy;DOC