Xiang Zhang
Xiang Zhang

Reputation: 2973

Can we create kafka time windowed stream from historical data?

I have some historical data, each record has their timestamp. I would like to read them and feed them into kafka topic, and use kafka stream to process them in a time windowed manner.

Now the question is, when I create kafka stream time windowed aggregation processor, how can I tell kafka to use timestamp field in the record to create time window, instead of real live time?

Upvotes: 3

Views: 748

Answers (1)

Robin Moffatt
Robin Moffatt

Reputation: 32090

You need to create a custom TimestampExtractor that will extract the value from the record itself - there's an example of this in the documentation, and here too. I also found this gist which looks relevant.

Upvotes: 4

Related Questions