Say I have a Flink SourceFunction<String>
called RequestsSource
.
On each request coming in from that source, I would like to subscribe to an external data source (for the purposes of an example, it could start a separate thread and start producing data on that thread).
The output data could be joined on a single DataStream
. For example
Input Requests: A, B Data produced: A1 B1 A2 A3 B2 ...
... and so on, with new elements being added to the DataStream forever.
How do I write a Flink Operator that can do this? Can I use e.g. FlatMapFunction
?