Lets say I have a Kafka topic named SensorData to which two sensors S1 and S2 are sending data (timestamp and value) to two different partitions e.g. S1 -> P1 and S2 -> P2. Now I need to aggregate the values for these two sensors separately, lets say calculating the average sensor value over a time window of 1 hour and writing it into a new topic SensorData1Hour. With this scenario
- How can I select a specific topic partition using the
KStreamBuilder#streammethod? - Is it possible to apply some aggregation function over two (multiple) different partitions from same topic?