Re: how to aggregate sessions

2018-07-17 Thread Vincent Maurin
I would say the SessionWindow is exactly the behavior you are describing, so the code you put should produce the expected result. Also check about timestamp extractor to be sure that you use timestamps that make sense for your use case : https://kafka.apache.org/11/documentation/streams/developer-g

Re: how to aggregate sessions

2018-07-17 Thread vbali
Hi Vincent, Thanks a bunch lot for the explanation. >you can choose when you want to produce your output event based on the state How do I achieve this? I want to hook into the session expiration to call my report function with the accumulated state once the inactivity gap for the given key is e

Re: how to aggregate sessions

2018-07-17 Thread Vincent Maurin
Hi Kafka streams sounds like a good solution there. The first step is to properly partition your event topics, based on the session key so all events for the same session will goes to the same partition. Then you could build your kafka streams application, that will maintains a state (manually man

how to aggregate sessions

2018-07-17 Thread vbali
Hi, My use case includes consuming events for sessions and once an inactivity gap is over creating a detailed report on them. From the docs (using 1.0.1 currently) it is not clear what is the best way to achieve this, it seems actions like reduce and aggregate create results with the same type as