'Kafka streams KTable recursive join
I have a KTable with master data that I use to enrich the data coming on kafka topic. This master data is generated from a master_data table that is hierarchical i.e. master_data has parent and children of type master_data. Right now the code I use to join and enrich raw data with master data leaf node looks like this
final KStream<String, String> enrichedWithMasterData = rawData
.leftJoin(masterTable,
(key, value) -> dataParser.getMasterCodeFromRawData(value), (rawData, masterData) -> {...}
How can I create a KStream by doing recursive joins untill I reach the root parent is reached. I want to enrich the raw data with all its master parents. The master_data hierarchy is dynamic which means there no fixed depth to the master_data tree, which means I can't write a static code with fixed number of statically defined KStreams.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
