I have a simple stream of status of objects :
define stream statusStream (id string, success bool);
I want to query all of objects which are "failed" (success=false) since 5 minutes : all event of statusStream (, false) where there are no event (same id, true) within 5 minutes.
What is the simplest siddhi query for this kind of job ?
Currently I have :
define stream statusStream (id string, success bool);
from statusStream[ success == false ]#window.time(5 minutes)
insert expired events into expiredStatusStream;
from every status = statusStream[ success == false ]
-> ackStatus = statusStream[ success == true and id == status.id]
or expiredStatus = expiredStatusStream[ id == status.id ]
select status.id, ackStatus.id as ackId
into filteredStatusStream;
from filteredStatusStream[ ackStatus.id is null ]
insert into failedStatusStream;