July 30, 2023

tNamedPipeOutput – Docs for ESB 7.x

tNamedPipeOutput

Writes data into an existing open named-pipe.

tNamedPipeOutput writes data into a named-pipe opened
with tNamedPipeOpen.

tNamedPipeOutput Standard properties

These properties are used to configure tNamedPipeOutput running in the Standard Job framework.

The Standard
tNamedPipeOutput component belongs to the File family.

The component in this framework is available in all Talend
products
.

Basic settings

Use existing pipe
connection

Select this check box to use an existing named-pipe in the
Pipe component list, or clear
this check box to specify a named-pipe in Pipe
name
field.

Pipe component

Select an existing named-pipe component from the list.

Note:

This check box will display only when you select Use existing pipe connection.

Pipe name

Fill in the field with the name of an existing named-pipe.

Note:

This check box will display only when you clear Use existing pipe connection.

Row separator

String (ex: ”
“on Unix) to distinguish rows in the output
file.

Field separator

Character, string or regular expression to separate fields of the
output file.

CSV options

Select this check box to take into account all parameters specific
to CSV files, in particular Escape
char
and Text
enclosure
parameters.

Schema and Edit
Schema

A schema is a row description, 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.

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.

Click Sync columns to retrieve
the schema from the previous component connected in the Job.

 

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
.

Delete pipe if it exists

Select this check box to avoid duplicate named-pipe.

Advanced settings

Boolean type

Select a boolean type from the list.

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

Global Variables

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

PIPE_NAME: the name of the named-pipe. This is a Flow
variable and it returns a string.

PIPE_NATIVE_NAME: the native name of the named-pipe. This
is a Flow variable and it returns a string.

PIPE_OUTPUTSTREAM: the output stream of the named-pipe.
This is a Flow variable and it returns an object.

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.

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

Usage rule

This component is usually connected to another component in a
subJob that reads data from a source.

Dynamic settings

Click the [+] button to add a row
in the table and fill the Code
field with a context variable to choose your pipe connection
dynamically from multiple connections planned in your Job.

The Dynamic settings table is
available only when the Use existing pipe
connection
check box is selected in the Basic settings view. When a dynamic
parameter is defined, the Pipe
component
list box in the Basic
settings
view becomes unusable.

For examples on using dynamic parameters, see Reading data from databases through context-based dynamic connections and Reading data from different MySQL databases using dynamically loaded connection parameters. For more information on Dynamic
settings
and context variables, see Talend Studio
User Guide.

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. You can find more details about how to install external modules in
Talend Help Center (https://help.talend.com)
.

Writing and loading data through a named-pipe

The following scenario creates a multi-component Job, which writes data into an
open named-pipe and displays the data onto the console.

tNamedPipeOutput_1.png

Dropping and linking the components

  1. Drop the following components from the Palette to the design workspace: tNamedPipeOpen, tParallelize, tNamedPipeClose, tFileInputDelimited, tSleep, tLogRow, tRowGenerator and tNamedPipeOutput.
  2. Connect tNamedPipeOpen to tParallelize using a Trigger
    >
    OnSubjobOk connection.
  3. Connect tParallelize to tFileInputDelimited using a Trigger > Parallelize
    connection.
  4. Connect tParallelize to tSleep using a Trigger > Parallelize
    connection.
  5. Connect tFileInputDelimited to tLogRow using a Row > Main
    connection.
  6. Connect tParallelize to tNamedPipeClose using a Trigger > Synchronize (Wait for
    all)
    connection.
  7. Connect tSleep to tRowGenerator using a Trigger > OnComponentOk
    connection.
  8. Connect tRowGenerator to tNamedPipeOutput using a Row > Main
    connection.

Configuring the components

Configuring the input component

  1. Double-click tNamedPipeOpen to define its
    propeties in its Basic settings view.

    Fill in the Name field with the name of a
    named-pipe and select Delete if already
    exist
    to avoid duplicate named-pipe.
    tNamedPipeOutput_2.png

  2. Double-click tParallelize to define its
    properties in its Basic settings
    view.

    Select end of all subJobs from the
    Wait for list.
    Fill in the Sleep Duration field with
    100 to set the sleep duration.
    tNamedPipeOutput_3.png

  3. Double-click tFileInputDelimited to
    define its properties in its Basic settings
    view.

    Fill in the File name/Stream
    field with the following expression to use the name of the existing
    named-pipe defined in the Basic settings
    view of tNamedPipeOpen:
    tNamedPipeOutput_4.png

  4. Click the three-dot button next to Edit
    schema
    .

    tNamedPipeOutput_5.png

  5. Click the plus button to add three columns for tFileInputDelimited. Fill the three Column fields with id,
    first_name and last_name and
    set the Type of id to
    Integer. Keep the rest of the settings
    as default.
  6. Click OK to save the settings for the
    schema.
  7. Keep the rest of the settings in the Basic
    settings
    view of tFileInputDelimited as default.
  8. Double-click tSleep and fill the
    Pause (in seconds) field with
    1.
  9. Double-click tRowGenerator to define its
    properties in its Basic settings
    view.
  10. Click RowGenerator Editor to define the
    schema.

    tNamedPipeOutput_6.png

  11. Click the plus button to add three columns for tRowGenerator. Fill the three Column fields with id,
    first_name and last_name and
    set the Type of id to
    Integer. Keep the rest of the settings of Type as default.
  12. Select sequence from the list in the
    Functions field for
    id.
  13. Select getFirstName from the list in the
    Functions field for Column
    first_name.
  14. Select
    Talend DataGenerator.getLastName
    from the list
    in the Functions field for Column
    last_name.
  15. Select id, fill the Value field under Function
    parameters
    tab with s1 for sequence identifier, 1001
    for start value and 1
    for step.
  16. Click OK to save the settings.

Configuring the output component

  1. Double-click tNamedPipeOutput to define
    its properties in its Basic settings
    view.

    tNamedPipeOutput_7.png

  2. Select the Use existing pipe connection
    check box and select tNamedPipeOpen_1 from
    the Pipe component list.
  3. Select Delete pipe if it exists to avoid
    duplicate named-pipe.
  4. Click Sync columns to retrieve the schema
    from the preceding component.
  5. Leave the rest of the settings as they are.
  6. Double-click tLogRow to define its
    properties in its Basic settings
    view.

    tNamedPipeOutput_8.png

  7. Click Sync columns to retrieve the schema
    from the preceding component.
  8. Select Table in the Mode area.

    tNamedPipeOutput_9.png

  9. Double-click tNamedPipeClose to define
    its properties in its Basic settings
    view.
  10. Select tNamedPipeOpen_1 from the
    Pipe list.

Saving and executing the Job

Press F6 to execute the Job.

tNamedPipeOutput_10.png

The data written into the named-pipe is displayed onto the console.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x