2
votes

I'm trying to find out how to implement the following logic having stream of events:

  1. First event appear in given time window(30s)
  2. Second event that is related to the first one(by some property) didn't appear in given time window
  3. Generate new error event

Currently I implemented the "opposite" implementation which was pretty easy:

stream.begin('first').where({conditions}).next('second').where({conditions}).within(Time.seconds(30))
1

1 Answers

0
votes

It's possible to use PatternTimeoutFunction to generate new events when the events aren't received in the time window. More about this type of functions and how to use it here: https://ci.apache.org/projects/flink/flink-docs-release-1.3/api/java/org/apache/flink/cep/PatternTimeoutFunction.html.