tSocketInput - 6.3

Talend Components Reference Guide

EnrichVersion
6.3
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 Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Function

tSocketInput component opens the socket port and listens for the incoming data.

Purpose

tSocketInput component is a listening component, allowing to pass data via a defined port

tSocketInput properties

Component family

Internet

 

Basic settings

Host name

Name or IP address of the Host server

 

Port

Listening port to open

 

Timeout

Number of seconds for the port to listen before closing.

 

Uncompress

Select this check box to unzip the data if relevant

 

Die on error

This check box is selected by default. Clear the check box to skip the row on error and complete the process for error-free rows. If needed, you can retrieve the rows on error via a Row > Rejects link.

 

Field separator

Character, string or regular expression to separate fields.

 

Row separator

String (ex: "\n"on Unix) to distinguish rows.

 

Escape Char

Character of the row to be escaped

 

Text enclosure

Character used to enclose text.

 

Schema type and Edit Schema

A schema is a row description, that is to say, it defines the number of fields to be processed and passed on to the next component. The schema is either Built-in or stored remotely in the Repository.

Since version 5.6, both the Built-In mode and the Repository mode are available in any of the Talend solutions.

Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this option to view the schema only.

  • Change to built-in property: choose this option to change the schema to Built-in for local changes.

  • Update repository connection: choose this option to change the schema stored in the repository and decide whether to propagate the changes to all the Jobs upon completion. If you just want to propagate the changes to the current Job, you can select No upon completion and choose this schema metadata again in the [Repository Content] window.

 

 

Built-in: The schema will be created and stored locally for this component only. Related topic: see Talend Studio User Guide.

 

 

Repository: The schema already exists and is stored in the Repository, hence can be reused in various projects and job flowcharts. Related topic: see Talend Studio User Guide.

 

Encoding type

Select the encoding from the list or select Custom and define it manually. This field is compulsory for DB data handling.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a Job level as well as at each component level.

Global Variables

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

NB_LINE: the number of rows read by an input component or transferred to an output component. This is an After variable and it returns an integer.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage

This component opens a point of access to a workstation or server. This component starts a Job and only stops after the time goes out.

Limitation

Due to license incompatibility, one or more JARs required to use this component are not provided. You can install the missing JARs for this particular component by clicking the Install button on the Component tab view. You can also find out and add all missing JARs easily on the Modules tab in the Integration perspective of your studio. For details, see the article Installing External Modules on Talend Help Center (https://help.talend.com) how to configure the Studio in the Talend Installation Guide.

Scenario: Passing on data to the listening port

The following scenario describes two Jobs aiming at passing data via a listening port. The first Job (SocketInput) opens the listening port and waits for the data to be sent over. The second Job (SocketOutput) passes delimited data from a file to a defined port number corresponding to the listening port.

Another application for the Socket components would be to allow controlled communication between servers which cannot communicate directly.

Dropping and linking components

  1. For the first Job, drop a tSocketInput component and a tLogRow component from the Palette to the design workspace, and link them using a Row > Main connection.

  2. For the second Job, drop a tFileInputDelimited component and a tSocketOutput component from the Palette to the design workspace, and link them using a Row > Main connection.

Configuring the Jobs

  1. On the second Job, select the tFileInputDelimited and on the Basic Settings tab of the Component view, set the access parameters to the input file.

  2. In File Name, browse to the file, and fill the Row, Field separators, and Header fields according to the input file used.

  3. Describe the Schema of the data to be passed on to the tSocketOutput component.

    The schema should be propagated automatically to the output component.

  4. Select the tSocketOutput component and set the parameters on the Basic Settings tab of the Component view.

  5. Define the Host IP address and the Port number where the data will be passed on to.

  6. Set the number of retries in the Retry field and the amount of time (in seconds) after which the Job will time out.

  7. Now on the other Job (SocketInput) design, define the parameters of the tSocketInput component.

  8. Define the Host IP address and the listening Port number where the data are passed on to.

  9. Set the amount of time (in seconds) after which the Job will time out.

  10. Edit the schema and set it to reflect the whole or part of the other Job's schema.

Executing the Jobs

  1. Press F6 to execute this Job (SocketInput) first, in order to open the listening port and prepare it to receive the passed data.

  2. Before the time-out, launch the other Job (SocketOutput) to pass on the data.

    The result displays on the Run view, along with the opening socket information.