Description:

The PutTCP processor receives a FlowFile and transmits the FlowFile content over a TCP connection to the configured TCP server. By default, the FlowFiles are transmitted over the same TCP connection (or pool of TCP connections if multiple input threads are configured). To assist the TCP server with determining message boundaries, an optional “Outgoing Message Delimiter” string can be configured which is appended to the end of each FlowFiles content when it is transmitted over the TCP connection. An optional “Connection Per FlowFile” parameter can be specified to change the behaviour so that each FlowFiles content is transmitted over a single TCP connection which is opened when the FlowFile is received and closed after the FlowFile has been sent. This option should only be used for low message volume scenarios, otherwise the platform may run out of TCP sockets.

Tags:

remote, egress, put, tcp

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the Expression Language Guide.

Name Default Value Allowable Values Description
Hostname localhost The ip address or hostname of the destination.
Port The port on the destination.
Max Size of Socket Send Buffer 1 MB The maximum size of the socket send buffer that should be used. This is a suggestion to the Operating System to indicate how big the socket buffer should be. If this value is set too low, the buffer may fill up before the data can be read, and incoming data will be dropped.
Idle Connection Expiration 5 seconds The amount of time a connection should be held open without being used before closing the connection
Connection Per FlowFile false *true *false Specifies whether to send each FlowFile's content on an individual connection.
Outgoing Message Delimiter \n Specifies the delimiter to use when sending messages out over the same TCP stream. The delimiter is appended to each FlowFile message that is transmitted over the stream so that the receiver can determine when one message ends and the next message begins. Users should ensure that the FlowFile content does not contain the delimiter character to avoid errors. In order to use a new line character you can enter '\n'. For a tab character use '\t'. Finally for a carriage return use '\r'. Supports Expression Language: true
Timeout 10 seconds The timeout for connecting to and communicating with the destination. Does not apply to UDP
SSL Context Service Controller Service API: SSLContextService Implementation: StandardSSLContextService The Controller Service to use in order to obtain an SSL Context. If this property is set, messages will be sent over a secure connection.
Character Set UTF-8 Specifies the character set of the data being sent.

Relationships:

Name Description
failure FlowFiles that failed to send to the destination are sent out this relationship.
success FlowFiles that are sent successfully to the destination are sent out this relationship.

Reads Attributes:

None specified.

Writes Attributes:

None specified.

State management:

This component does not store state.

Restricted:

This component is not restricted.

How to configure?

Step 1: Drag and drop the PutTCP processor to canvas.

Step 2: Double click the processor to configure, the configuration dialog will be opened as follows,

properties

Step 3: Check the usage of each property and update those values.

Properties and usage

Hostname: Enter the ipaddress or hostname of the destination TCP (Transmission Control Protocol) server.

Port: Specifies the port number of the destination TCP server.

Max Size of Socket Send Buffer: It is used to specify the maximum size of the socket send buffer that should be used.

Idle Connection Expiration: Specifies the amount of time a connection should be held open without being used before closing the connection.

Connection Per FlowFile: Specifies whether each flow file should be send in separate connection or in same connection.

Outgoing Message Delimiter: Specifies the delimiter to be used for identifying flow files. The delimiter is appended to each flow file message that is transmitted over the stream, so that the receiver can determine when one message ends and the next message begins.

Timeout: Specifies the maximum waiting time for connecting to the destination.

SSL Context Service: It is used to specify controller service for obtaining an SSL context. If this property is set, messages will be sent over a secure connection.

Character Set: Used to specify the character set of data.

For example, to send messages to 7078 port, configure the PutTCP processor as follows,

sample