Terabyte
08/01/2025, 4:10 PMstate which is either { OPEN, CLOSED } and a timestamp for EventTime processing.
> • Events arrive continuously and may flap between open and close very rapidly.
>
> When an Open event is received:
> • Emit open immediately (don't wait) - this ensures potential problems trigger alerts right away.
> When a close event is received.
> • Do not emit it immediately.
> • Instead start a 20 second timer
> • If no new open arrives during those 20 seconds, emit the close when the timer fires.
> If another open arrives before the timer fires
> • Cancel the timer
> • The close is suppressed....
> • The open is dropped but this is ok because the state is already open.
Is there a pattern for this?
EventSessionWindows feel not quite right as they do not allow immediate emitting of Opens.Terabyte
08/01/2025, 4:27 PMLee Wallen
08/01/2025, 11:46 PMctx*.*timerService*().*deleteEventTimeTimer*(*timestampOfTimerToStop*);*) . You can get the timestamp to use. by adding 20 seconds to the state's last updated time value.
• update the state's last updated time to the incoming open event's event time.