From a15ee0a33e04e6b59c3faa3928ae854f1c362ae2 Mon Sep 17 00:00:00 2001 From: zhilinli Date: Fri, 11 Aug 2023 21:47:01 +0800 Subject: [PATCH] [Feature][doc][Connector-V2][Socket] Add Socket connector doc #5255 --- docs/en/connector-v2/sink/Socket.md | 76 ++++++++++----------------- docs/en/connector-v2/source/Socket.md | 60 ++++++++------------- 2 files changed, 50 insertions(+), 86 deletions(-) diff --git a/docs/en/connector-v2/sink/Socket.md b/docs/en/connector-v2/sink/Socket.md index bb5ac612cc1..8d932dcfbd8 100644 --- a/docs/en/connector-v2/sink/Socket.md +++ b/docs/en/connector-v2/sink/Socket.md @@ -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
+> Flink
+> SeaTunnel Zeta
## 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 { @@ -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 diff --git a/docs/en/connector-v2/source/Socket.md b/docs/en/connector-v2/source/Socket.md index 2ce5848cb2d..d2e17497c79 100644 --- a/docs/en/connector-v2/source/Socket.md +++ b/docs/en/connector-v2/source/Socket.md @@ -2,9 +2,11 @@ > Socket source connector -## Description +## Support Those Engines -Used to read data from Socket. +> Spark
+> Flink
+> SeaTunnel Zeta
## Key features @@ -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