Skip to content

Commit

Permalink
[Doc][Improve] support chinese [docs/zh/connector-v2/sink/Socket.md] (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
duzhendi authored Feb 19, 2025
1 parent d78b143 commit b83076c
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions docs/zh/connector-v2/sink/Socket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Socket

> Socket 数据接收器
## 支持引擎

> Spark<br/>
> Flink<br/>
> SeaTunnel Zeta<br/>
## 主要特性

- [ ] [exactly-once](../../concept/connector-v2-features.md)

## 描述

用于向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端的随机生成数据
```hocon
env {
parallelism = 1
job.mode = "STREAMING"
}
source {
FakeSource {
plugin_output = "fake"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}
sink {
Socket {
host = "localhost"
port = 9999
}
}
```

* 启动端口侦听

```shell
nc -l -v 9999
```

* 启动SeaTunnel任务

* Socket 服务器控制台打印数据

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

## 更改日志

### 2.2.0-beta 2022-09-26

- 添加Socket 数据接收器

0 comments on commit b83076c

Please sign in to comment.