Hi all -

I’m trying to keep some state around for a little while after a window fires to 
use as queryable state. I am intending on using something like:

.keyBy(<aggregation key, no explicit time component>)
.timeWindow(Time.minutes(1)).allowedLateness(Time.minutes(90))
.aggregate(…)
.keyBy(<query key, includes a time component>)
.asQueryableState(...)

My intent is to keep that window available for 90 minutes. I’m not sure how I 
feel about this pattern - it feels more side-effect-y than intentional.

My questions:
a) Is that actually going to keep the window (and, by implication, the 
downstream state) around?
b) Is there a “more correct” way to do this? Maybe it would be better to use 
some kind of time-aware reducing state that will provide some lingering state?

Before you ask, no, I haven’t run it to see what it does. That’s next, but I 
figured I’d ask for your advice first

Reply via email to