Skip to content

Commit a15ee0a

Browse files
committed
[Feature][doc][Connector-V2][Socket] Add Socket connector doc apache#5255
1 parent 84d8cc3 commit a15ee0a

File tree

2 files changed

+50
-86
lines changed

2 files changed

+50
-86
lines changed

docs/en/connector-v2/sink/Socket.md

Lines changed: 27 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,34 @@
22

33
> Socket sink connector
44
5-
## Description
5+
## Support Those Engines
66

7-
Used to send data to Socket Server. Both support streaming and batch mode.
8-
9-
> 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}`
7+
> Spark<br/>
8+
> Flink<br/>
9+
> SeaTunnel Zeta<br/>
1010
1111
## Key features
1212

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

15-
## Options
16-
17-
| name | type | required | default value |
18-
|----------------|---------|----------|---------------|
19-
| host | String | Yes | |
20-
| port | Integer | yes | |
21-
| max_retries | Integer | No | 3 |
22-
| common-options | | no | - |
23-
24-
### host [string]
25-
26-
socket server host
27-
28-
### port [integer]
29-
30-
socket server port
31-
32-
### max_retries [integer]
33-
34-
The number of retries to send record failed
35-
36-
### common options
15+
## Description
3716

38-
Sink plugin common parameters, please refer to [Sink Common Options](common-options.md) for details
17+
Used to send data to Socket Server. Both support streaming and batch mode.
3918

40-
## Example
19+
> 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}`
4120
42-
simple:
21+
## Sink Options
4322

44-
```hocon
45-
Socket {
46-
host = "localhost"
47-
port = 9999
48-
}
49-
```
23+
| Name | Type | Required | Default | Description |
24+
|----------------|---------|----------|---------|---------------------------------------------------------------------------------------------------------|
25+
| host | String | Yes | | socket server host |
26+
| port | Integer | Yes | | socket server port |
27+
| max_retries | Integer | No | 3 | The number of retries to send record failed |
28+
| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |
5029

51-
test:
30+
## Task Example
5231

53-
* Configuring the SeaTunnel config file
32+
> This is randomly generated data written to the Socket side
5433
5534
```hocon
5635
env {
@@ -59,24 +38,23 @@ env {
5938
}
6039
6140
source {
62-
FakeSource {
63-
result_table_name = "fake"
64-
schema = {
65-
fields {
66-
name = "string"
67-
age = "int"
68-
}
41+
FakeSource {
42+
result_table_name = "fake"
43+
schema = {
44+
fields {
45+
name = "string"
46+
age = "int"
6947
}
7048
}
49+
}
7150
}
7251
7352
sink {
74-
Socket {
75-
host = "localhost"
76-
port = 9999
77-
}
53+
Socket {
54+
host = "localhost"
55+
port = 9999
56+
}
7857
}
79-
8058
```
8159

8260
* Start a port listening

docs/en/connector-v2/source/Socket.md

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
> Socket source connector
44
5-
## Description
5+
## Support Those Engines
66

7-
Used to read data from Socket.
7+
> Spark<br/>
8+
> Flink<br/>
9+
> SeaTunnel Zeta<br/>
810
911
## Key features
1012

@@ -15,58 +17,42 @@ Used to read data from Socket.
1517
- [ ] [parallelism](../../concept/connector-v2-features.md)
1618
- [ ] [support user-defined split](../../concept/connector-v2-features.md)
1719

18-
## Options
19-
20-
| name | type | required | default value |
21-
|----------------|---------|----------|---------------|
22-
| host | String | Yes | |
23-
| port | Integer | Yes | |
24-
| common-options | | no | - |
25-
26-
### host [string]
27-
28-
socket server host
29-
30-
### port [integer]
31-
32-
socket server port
33-
34-
### common options
20+
## Description
3521

36-
Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details
22+
> Used to read data from Socket.
3723
38-
## Example
24+
## Source Options
3925

40-
simple:
26+
| Name | Type | Required | Default | Description |
27+
|----------------|---------|----------|---------|---------------------------------------------------------------------------------------------------------|
28+
| host | String | Yes | | socket server host |
29+
| port | Integer | Yes | | socket server port |
30+
| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |
4131

42-
```hocon
43-
Socket {
44-
host = "localhost"
45-
port = 9999
46-
}
47-
```
32+
## Task Example
4833

49-
test:
34+
### Simple:
5035

51-
* Configuring the SeaTunnel config file
36+
> This is a streaming accept Socket data source Writes to console output
5237
5338
```hocon
5439
env {
40+
# You can set flink configuration here
5541
execution.parallelism = 1
56-
job.mode = "STREAMING"
42+
}
43+
Socket {
44+
host = "localhost"
45+
port = 9999
5746
}
5847
59-
source {
60-
Socket {
61-
host = "localhost"
62-
port = 9999
63-
}
48+
transform {
49+
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
50+
# please go to https://seatunnel.apache.org/docs/transform-v2/sql
6451
}
6552
6653
sink {
6754
Console {}
6855
}
69-
7056
```
7157

7258
* Start a port listening

0 commit comments

Comments
 (0)