Catching messages triggered by a tWarn component - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This example shows you how to use the tLogCatcher component to catch the messages triggered by a tWarn component.

Creating a Job for catching messages triggered by a tWarn component

Create a Job to trigger some messages using the tWarn component, then catch the messages using the tLogCatcher component and display the messages on the console.

  1. Create a new Job and add a tRowGenerator component, a tWarn component, a tLogCatcher component, and a tLogRow component by typing their names in the design workspace or dropping them from the Palette.

  2. Link the tRowGenerator component to the tWarn component using a Row > Main connection.

  3. Link the tLogCatcher component to the tLogRow component using a Row > Main connection.

Configuring the Job for catching messages triggered by the tWarn component

Configure the components used in the Job that catches the messages triggered by the tWarn component and then displays the messages on the console.

  1. Double-click the tRowGenerator component to open its row generator editor.

  2. Define the schema by adding one column id of Integer type, and select the predefined function Numeric.sequence(String,int,int) in the Functions column.

  3. Enter the number of records to be generated in the Number of Rows for RowGenerator field, 3 in this example. When done, click OK to close the dialog box.

  4. Double-click the tWarn component to open its Basic settings view.

  5. Select Info from the Priority drop-down list.

  6. In the Warn message field, enter the message to be triggered when a new record is generated, a new record is generated in this example.

  7. Double-click the tLogCatcher component to open its Basic settings view.

  8. Select the Catch tWarn check box to catch the messages triggered by the tWarn component.

  9. Double-click the tLogRow component to open its Basic settings view, and then select Table (print values in cells of a table) in the Mode area for better readability of the result.

Executing the Job to catch messages triggered by a tWarn component

After setting up the Job and configuring the components used in the Job for catching messages triggered by the tWarn component, you can then execute the Job and verify the Job execution result.

  1. Press Ctrl + S to save the Job.

  2. Press F6 to execute the Job.

    As shown above, all messages triggered are collected and displayed on the console.