Skip to main content
Version: Next

Socket

Socket sink connector

Support Those Engines​

Spark
Flink
SeaTunnel Zeta

Key features​

Description​

Used to send data to Socket Server. Both support streaming and batch mode.

For example, if the data from upstream is [age: 12, name: jared], the content send to socket server is the following: {"name":"jared","age":17}

Sink Options​

NameTypeRequiredDefaultDescription
hostStringYessocket server host
portIntegerYessocket server port
max_retriesIntegerNo3The number of retries to send record failed
common-optionsNo-Source plugin common parameters, please refer to Source Common Options for details

Task Example​

This is randomly generated data written to the Socket side

env {
parallelism = 1
job.mode = "STREAMING"
}

source {
FakeSource {
result_table_name = "fake"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}

sink {
Socket {
host = "localhost"
port = 9999
}
}
  • Start a port listening
nc -l -v 9999
  • Start a SeaTunnel task

  • Socket Server Console print data

{"name":"jared","age":17}

Changelog​

2.2.0-beta 2022-09-26​

  • Add Socket Sink Connector