Skip to content

Commit

Permalink
[Feature][doc][Connector-V2][Socket] Add Socket connector doc apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhilinli123 committed Aug 11, 2023
1 parent 84d8cc3 commit a15ee0a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 86 deletions.
76 changes: 27 additions & 49 deletions docs/en/connector-v2/sink/Socket.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,34 @@

> Socket sink connector
## Description
## Support Those Engines

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}`
> Spark<br/>
> Flink<br/>
> SeaTunnel Zeta<br/>
## Key features

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

## Options

| name | type | required | default value |
|----------------|---------|----------|---------------|
| host | String | Yes | |
| port | Integer | yes | |
| max_retries | Integer | No | 3 |
| common-options | | no | - |

### host [string]

socket server host

### port [integer]

socket server port

### max_retries [integer]

The number of retries to send record failed

### common options
## Description

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

## Example
> 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}`
simple:
## Sink Options

```hocon
Socket {
host = "localhost"
port = 9999
}
```
| Name | Type | Required | Default | Description |
|----------------|---------|----------|---------|---------------------------------------------------------------------------------------------------------|
| host | String | Yes | | socket server host |
| port | Integer | Yes | | socket server port |
| max_retries | Integer | No | 3 | The number of retries to send record failed |
| common-options | | No | - | Source plugin common parameters, please refer to [Source Common Options](common-options.md) for details |

test:
## Task Example

* Configuring the SeaTunnel config file
> This is randomly generated data written to the Socket side
```hocon
env {
Expand All @@ -59,24 +38,23 @@ env {
}
source {
FakeSource {
result_table_name = "fake"
schema = {
fields {
name = "string"
age = "int"
}
FakeSource {
result_table_name = "fake"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}
sink {
Socket {
host = "localhost"
port = 9999
}
Socket {
host = "localhost"
port = 9999
}
}
```

* Start a port listening
Expand Down
60 changes: 23 additions & 37 deletions docs/en/connector-v2/source/Socket.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

> Socket source connector
## Description
## Support Those Engines

Used to read data from Socket.
> Spark<br/>
> Flink<br/>
> SeaTunnel Zeta<br/>
## Key features

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

## Options

| name | type | required | default value |
|----------------|---------|----------|---------------|
| host | String | Yes | |
| port | Integer | Yes | |
| common-options | | no | - |

### host [string]

socket server host

### port [integer]

socket server port

### common options
## Description

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

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

```hocon
Socket {
host = "localhost"
port = 9999
}
```
## Task Example

test:
### Simple:

* Configuring the SeaTunnel config file
> This is a streaming accept Socket data source Writes to console output
```hocon
env {
# You can set flink configuration here
execution.parallelism = 1
job.mode = "STREAMING"
}
Socket {
host = "localhost"
port = 9999
}
source {
Socket {
host = "localhost"
port = 9999
}
transform {
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
# please go to https://seatunnel.apache.org/docs/transform-v2/sql
}
sink {
Console {}
}
```

* Start a port listening
Expand Down

0 comments on commit a15ee0a

Please sign in to comment.