Skip to main content
Version: 2.3.10

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 {
plugin_output = "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

Change Log
ChangeCommitVersion
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d032.3.9
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755)https://github.com/apache/seatunnel/commit/8de7408102.3.4
[Improve][build] Give the maven module a human readable name (#4114)https://github.com/apache/seatunnel/commit/d7cd601052.3.1
[Improve][Project] Code format with spotless plugin. (#4101)https://github.com/apache/seatunnel/commit/a2ab166562.3.1
[Feature][Connector] add get source method to all source connector (#3846)https://github.com/apache/seatunnel/commit/417178fb82.3.1
[Hotfix][OptionRule] Fix option rule about all connectors (#3592)https://github.com/apache/seatunnel/commit/226dc6a112.3.0
[Improve][Connector-V2][Socket] Unified exception for socket source & sink connector (#3511)https://github.com/apache/seatunnel/commit/581292f212.3.0
[feature][connector][socket] Add Socket Connector Option Rules (#3317)https://github.com/apache/seatunnel/commit/b85317bcb2.3.0
[Improve][all] change Log to @Slf4j (#3001)https://github.com/apache/seatunnel/commit/6016100f12.3.0-beta
[DEV][Api] Replace SeaTunnelContext with JobContext and remove singleton pattern (#2706)https://github.com/apache/seatunnel/commit/cbf82f7552.2.0-beta
[#2606]Dependency management split (#2630)https://github.com/apache/seatunnel/commit/fc047be692.2.0-beta
[Feature][Connector-V2] Socket Connector Sink (#2549)https://github.com/apache/seatunnel/commit/94f4600a42.2.0-beta
[api-draft][Optimize] Optimize module name (#2062)https://github.com/apache/seatunnel/commit/f79e3112b2.2.0-beta