I'm setting up Apache Flink connected with Kafka broker.
I got a the following messages in random order:
- message(timestamp=[..], index=1, someData=[..])
- message(timestamp=[..], index=2, someData=[..])
- message(timestamp=[..], index=3, someData=[..])
- message(timestamp=[..], index=2, someData=[..])
- message(timestamp=[..], index=3, someData=[..])
- message(timestamp=[..], index=1, someData=[..])
My records coming from Kafka got a index
field.
In my application, i need to compute last two of these records that have a same id and then immediately send the response.
For example, these two:
- message(timestamp=[..], index=1, someData=[..])
- message(timestamp=[..], index=1, someData=[..])
Whats the best way to store and compute last two records with the same index field? Could you tell me some tips?