I'm reading 2 kafka topics in the same flink jobs.
Stream1: Messages comes from the first topic are saved to rocksdb, then it will union with stream2.Stream2: Messages comes from the second topic are enriched with state saved by stream1, then it will union with the stream1.
Topic1 and topic 2 are different sources but basically the output is the same for two sources. I have to just enrich data come from topic2 with the data come from topic1.
Here is flow;
val stream1 = readKafkaTopic1().keyBy(_.memberId).map(saveMemberDetailsToRocksDB)
val stream2 = readKafkaTopic2().keyBy(_.memberId).map(readMemberDetailsAndEnrich)
stream1.union(stream2).addSink(kafkaProducer)
Here is the questions;
- Is that flow good?
- Can
stream2access the state that saved bystream1for the samememberId?