Page tree
Skip to end of metadata
Go to start of metadata

The TCPClient transport handler allows the delivery of results over TCP/IP to an arbitrary host. This transport handler can be used in both directions, connecting to a server to receive data and connect to a server to publish data.

Options

  • host: The host/IP of the target

  • port: The port of the target system

  • read: The size of the read buffer (optional)

  • write: The size of the write buffer (optional)

  • init: Initialization commands to send as soon as the connection is established. Use "\n" in the commands to send newlines (optional)

Sometime multiple host should be accessed and the first one that can be reached should be used:

  • hosts: comma separated list of server
  • ports: comma separated list of ports

Example

PQL

TCPClient Transport Handler
input = ACCESS({source='Source',
wrapper='GenericPush',
transport='TCPClient',
protocol='CSV',
dataHandler='Tuple',
options=[['host', 'example.com'],['port', '8080'],['read', '10240'],['write', '10240']],
schema=[
['id', 'Double'],
['data', 'String']]
})

output = SENDER({sink='Sink',
wrapper='GenericPush',
transport='TCPClient',
protocol='CSV',
dataHandler='Tuple',
options=[['host', 'example.com'],['port', '8081'],['read', '10240'],['write', '10240']]
}, input)

CQL

TCPClient Transport Handler
CREATE STREAM source (id Double, data STRING)
    WRAPPER 'GenericPush'
    PROTOCOL 'CSV'
    TRANSPORT 'TCPClient'
    DATAHANDLER 'Tuple'
    OPTIONS ( 'host' 'example.com', 'port' '8080', 'read' '10240', 'write' '10240')


CREATE SINK sink (id Double, data STRING)
    WRAPPER 'GenericPush'
    PROTOCOL 'CSV'
    TRANSPORT 'TCPClient'
    DATAHANDLER 'Tuple'
    OPTIONS ( 'host' 'example.com', 'port' '8080', 'read' '10240', 'write' '10240')

  • No labels