From: John Roesler <j...@confluent.io> > As you noticed, a windowed computation won't work here, because you would > be wanting to alert on things that are absent from the window.
> Instead, you can use a custom Processor with a Key/Value store and schedule > punctuations to send the alerts. For example, you can store the state and > the time of the transition to that state, and finally whether an alert has > been sent for that widget. You can schedule a punctuation to scan over the > whole store. For any record that's been disconnected for more than 5m and > *not* sent an alert, you send the alert and set the "sent" flag. Since you > only need to consider widgets whose last transition was a disconnect and > that have *not* had an alert sent, you can keep the store pretty compact by > dropping entries when you send the alert or when they transition from > "disconnected to connected". So the store doesn't need to contain any > widget whose state is currently "connected" or who is disconnected and has > already been alerted. OK, done all that (using a Transformer instead of a Processor). There's some serious magic going on there, in relation to how I can crash the application and restart it and all the state is preserved with my having to write 0 characters of code to achieve this - I think I'm going to like Kafka Streams. Thanks. Tim Ward The contents of this email and any attachment are confidential to the intended recipient(s). If you are not an intended recipient: (i) do not use, disclose, distribute, copy or publish this email or its contents; (ii) please contact the sender immediately; and (iii) delete this email. Our privacy policy is available here: https://origamienergy.com/privacy-policy/. Origami Energy Limited (company number 8619644); Origami Storage Limited (company number 10436515) and OSSPV001 Limited (company number 10933403), each registered in England and each with a registered office at: Ashcombe Court, Woolsack Way, Godalming, GU7 1LQ.