Skip to main content
Version: 2.2.0-beta

Socket

Socket source connector

Description

Used to read data from Socket.

Key features

Options

nametyperequireddefault value
hostStringNolocalhost
portIntegerNo9999

host [string]

socket server host

port [integer]

socket server port

Example

simple:

Socket {
host = "localhost"
port = 9999
}

test:

  • Configuring the SeaTunnel config file
env {
execution.parallelism = 1
job.mode = "STREAMING"
}

source {
Socket {
host = "localhost"
port = 9999
}
}

transform {
}

sink {
Console {}
}

  • Start a port listening
nc -l 9999
  • Start a SeaTunnel task

  • Socket Source send test data

~ nc -l 9999
test
hello
flink
spark
  • Console Sink print data
[test]
[hello]
[flink]
[spark]