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

Java custom code

EnrichVersion
7.0
EnrichProdName
Talend Big Data
Talend Big Data Platform
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 ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
EnrichPlatform
Talend Studio
task
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