Listens for incoming TCP connections and reads data from each connection using a line separator as the message demarcator. The default behavior is for each message to produce a single FlowFile, however this can be controlled by increasing the Batch Size to a larger value for higher throughput. The Receive Buffer Size must be set as large as the largest messages expected to be received, meaning if every 100kb there is a line separator, then the Receive Buffer Size must be greater than 100kb.
listen, tcp, tls, ssl
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|
|Local Network Interface||
The name of a local network interface to be used to restrict listening to a specific LAN.
Supports Expression Language: true
|Port||The port to listen on for communication.|
|Receive Buffer Size||65507 B||The size of each buffer used to receive messages. Adjust this value appropriately based on the expected size of the incoming messages.|
|Max Size of Message Queue||10000||The maximum size of the internal queue used to buffer messages being transferred from the underlying channel to the processor. Setting this value higher allows more messages to be buffered in memory during surges of incoming messages, but increases the total memory used by the processor.|
|Max Size of Socket Buffer||1 MB||The maximum size of the socket 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.|
|Character Set||UTF-8||Specifies the character set of the received data.|
|Max Batch Size||1||The maximum number of messages to add to a single FlowFile. If multiple messages are available, they will be concatenated along with the <Message Delimiter> up to this configured maximum number of messages|
|Batching Message Delimiter||\n||Specifies the delimiter to place between messages when multiple messages are bundled together (see <Max Batch Size> property).|
|Max Number of TCP Connections||2||The maximum number of concurrent TCP connections to accept.|
|SSL Context Service||
Controller Service API:
|The Controller Service to use in order to obtain an SSL Context. If this property is set, messages will be received over a secure connection.|
|The client authentication policy to use for the SSL Context. Only used if an SSL Context Service is provided.|
|success||Messages received successfully will be sent out this relationship.|
|tcp.sender||The sending host of the messages.|
|tcp.port||The sending port the messages were received.|
How to configure?
Step 1: Drag and drop the ListenTCP processor to canvas.
Step 2: Double click the processor to configure, the configuration dialog will be opened as follows,
Step 3: Check the usage of each property and update those values.
Properties and usage:
Local Network Interface: Specifies the name of a local network interface used to restrict listening to a specific LAN
Port: Specifies the port number to listen for communication.
Receive Buffer Size:** It is used to specify the size of buffer used to receive messages.
Max Size of Message Queue: Specifies the maximum size of the internal queue used to buffer messages being transferred from the underlying channel to the processor.
Max Size of Socket Buffer: Specifies the maximum size of the socket buffer that should be used.
Character Set: Used to specify the character set of received data.
Max Batch Size: Used to specify the maximum number of messages to be added to a single flow file. If multiple messages are available, they will be concatenated along with the <Message Delimiter> up to the size specified.
Batching Message Delimiter: Specifies the delimiter used between messages when multiple messages are bundled together.
Max Number of TCP Connections: Specifies how many number of concurrent TCP (Transmission Control Protocol) connections can be accepted.
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.
Client Auth: Sets the client authentication policy used when SSL context service is set.
For example, to listen the messages from 7078 port, configure the ListenTCP processor as shown in the following screenshot,