Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 Minute aggregate giving wrong result in Kafka 2.4.0 #8

Open
sounaks01 opened this issue Mar 29, 2021 · 0 comments
Open

1 Minute aggregate giving wrong result in Kafka 2.4.0 #8

sounaks01 opened this issue Mar 29, 2021 · 0 comments

Comments

@sounaks01
Copy link

Using latest windowedBy()

final TimeWindows window = TimeWindows.of(Duration.ofMinutes(1));
......
 .windowedBy(window)

Then printing the stream

        stats.foreach((key, value) -> logger.info("Key >>>>> "+ key + 
				" Value => "+value.countTrades));

I am getting below output

Line 817: [2021-03-29 15:40:21,444] INFO Key >>>>> [AES@1617012600000/1617012660000] Value => 19 (com.shapira.examples.streams.stockstats.StockStatsExample)
Line 823: [2021-03-29 15:40:52,111] INFO Key >>>>> [AES@1617012600000/1617012660000] Value => 43 (com.shapira.examples.streams.stockstats.StockStatsExample)
Line 837: [2021-03-29 15:41:24,076] INFO Key >>>>> [AES@1617012600000/1617012660000] Value => 55 (com.shapira.examples.streams.stockstats.StockStatsExample)

Whereas I was expecting a Key and TimeWindow combination single record. But here two/three records are coming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant