21
- January
2020
Posted By : Alexander Goida
Siddhi: Non-occurrence Event in Data Stream

Some behavior patterns in event stream are based on the fact that specific event hasn’t happened. has in-built mechanism to capture when some event is not happened after another. Here is the simple code example of the pattern.

The example defines an input stream with two fields. The field S of type string is the one which is important for this example. I want to capture cases when after event where S = ‘A’, there is no event with S = ‘Z’ during 5 seconds after the 1st one. At the same time there might be other events within this interval.

Important to note that if you have dependent patterns, then they need to be located in different Siddhi applications. The example below includes this aspect also.

The event will be sent to the stream non when there is no events with ‘Z’ happened.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.