Skip to main content

tcp (Source)

A Stream App application can be configured to receive events via the TCP transport by adding the type='tcp' annotation at the top of an event stream definition. When this is defined the associated stream will receive events from the TCP transport on the host and port defined in the system.

Syntax

CREATE SOURCE <NAME> WITH (type="tcp", map.type="<STRING>", context="<STRING>")

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
contextThe URL context that should be used to receive the events./STRINGYesNo

System Parameters

NameDescriptionDefault ValuePossible Parameters
hostTcp server host.0.0.0.0Any valid host or IP
portTcp server port.9892Any integer representing valid port
receiver.threadsNumber of threads to receive connections.10Any positive integer
worker.threadsNumber of threads to serve events.10Any positive integer
tcp.no.delayThis is to specify whether to disable Nagle algorithm during message passing. If tcp.no.delay = true, the execution of Nagle algorithm will be disabled in the underlying TCP logic. Hence there will be no delay between two successive writes to the TCP connection. Else there can be a constant ack delay.truetrue false
keep.aliveThis property defines whether the server should be kept alive when there are no connections available.truetrue false

Example 1

CREATE SOURCE Foo WITH (type = 'tcp', context='abc', map.type='binary') (attribute1 string, attribute2 int );

Under this configuration, events are received via the TCP transport on default host,port, abc context, and they are passed to Foo stream for processing.