Socket sink connector

Support Those Engines

Spark
Flink
SeaTunnel Zeta

Key features

Description

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}

Sink Options

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 for details

Task Example

This is randomly generated data written to the Socket side

  1. env {
  2. parallelism = 1
  3. job.mode = "STREAMING"
  4. }
  5. source {
  6. FakeSource {
  7. result_table_name = "fake"
  8. schema = {
  9. fields {
  10. name = "string"
  11. age = "int"
  12. }
  13. }
  14. }
  15. }
  16. sink {
  17. Socket {
  18. host = "localhost"
  19. port = 9999
  20. }
  21. }
  • Start a port listening
  1. nc -l -v 9999
  • Start a SeaTunnel task

  • Socket Server Console print data

  1. {"name":"jared","age":17}

Changelog

2.2.0-beta 2022-09-26

  • Add Socket Sink Connector