Socket
Socket 数据接收器
支持引擎
Spark
Flink
SeaTunnel Zeta
主要特性
描述
用于向Socket Server发送数据。两者都支持流媒体和批处理模式。
例如,如果来自上游的数据是[
age:12,name:jared
],则发送到Socket服务器的内容如下:{"name":"jared","age":17}
Sink 选项
名称 | 类型 | 是否必传 | 默认值 | 描述 |
---|---|---|---|---|
host | String | 是 | socket 服务器主机 | |
port | Integer | 是 | socket 服务器端口 | |
max_retries | Integer | 否 | 3 | 发送记录的重试失败次数 |
common-options | 否 | - | 源插件常用参数,详见[Source common Options](../sink common-Options.md) |
任务示例
这是写入Socket端的随机生成数据
env {
parallelism = 1
job.mode = "STREAMING"
}
source {
FakeSource {
plugin_output = "fake"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}
sink {
Socket {
host = "localhost"
port = 9999
}
}
- 启动端口侦听
nc -l -v 9999
启动SeaTunnel任务
Socket 服务器控制台打印数据
{"name":"jared","age":17}
变更日志
Change Log
Change | Commit | Version |
---|---|---|
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786) | https://github.com/apache/seatunnel/commit/6b7c53d03c | 2.3.9 |
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755) | https://github.com/apache/seatunnel/commit/8de7408100 | 2.3.4 |
[Improve][build] Give the maven module a human readable name (#4114) | https://github.com/apache/seatunnel/commit/d7cd601051 | 2.3.1 |
[Improve][Project] Code format with spotless plugin. (#4101) | https://github.com/apache/seatunnel/commit/a2ab166561 | 2.3.1 |
[Feature][Connector] add get source method to all source connector (#3846) | https://github.com/apache/seatunnel/commit/417178fb84 | 2.3.1 |
[Hotfix][OptionRule] Fix option rule about all connectors (#3592) | https://github.com/apache/seatunnel/commit/226dc6a119 | 2.3.0 |
[Improve][Connector-V2][Socket] Unified exception for socket source & sink connector (#3511) | https://github.com/apache/seatunnel/commit/581292f210 | 2.3.0 |
[feature][connector][socket] Add Socket Connector Option Rules (#3317) | https://github.com/apache/seatunnel/commit/b85317bcbe | 2.3.0 |
[Improve][all] change Log to @Slf4j (#3001) | https://github.com/apache/seatunnel/commit/6016100f12 | 2.3.0-beta |
[DEV][Api] Replace SeaTunnelContext with JobContext and remove singleton pattern (#2706) | https://github.com/apache/seatunnel/commit/cbf82f755c | 2.2.0-beta |
[#2606]Dependency management split (#2630) | https://github.com/apache/seatunnel/commit/fc047be69b | 2.2.0-beta |
[Feature][Connector-V2] Socket Connector Sink (#2549) | https://github.com/apache/seatunnel/commit/94f4600a4e | 2.2.0-beta |
[api-draft][Optimize] Optimize module name (#2062) | https://github.com/apache/seatunnel/commit/f79e3112b1 | 2.2.0-beta |