This connector provides tcp source and http source for receiving push data, implemented by Netty.
Note that the streaming connectors are not part of the binary distribution of Flink. You need to link them into your job jar for cluster execution. See how to link with them for cluster execution here.
+-------------+ (2) +------------------------+
| user system | <----- | Third Register Service |
+-------------+ +------------------------+
| ^
| (3) |
| |
V |
+--------------------+ |
| Flink Netty Source | ----------------+
+--------------------+ (1)
There are three components:
Flink Netty Source
’s register request (ip and port)User System
To use this connector, add the following dependency to your project:
<dependency>
<groupId>org.apache.bahir</groupId>
<artifactId>flink-connector-netty_2.11</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
Tcp Source:
val env = StreamExecutionEnvironment.getExecutionEnvironment
env.addSource(new TcpReceiverSource("msg", 7070, Some("http://localhost:9090/cb")))
paramKey: the http query param key tryPort: try to use this point, if this point is used then try a new port callbackUrl: register connector’s ip and port to a
Third Register Service
Http Source:
val env = StreamExecutionEnvironment.getExecutionEnvironment
env.addSource(new TcpReceiverSource(7070, Some("http://localhost:9090/cb")))
tryPort: try to use this port, if this point is used then try a new port callbackUrl: register connector’s ip and port to a
Third Register Service
There are two example to get started: