ich einen einfachen Strom von Status von Objekten haben:Anpassung der Abwesenheit von Ereignissen
define stream statusStream (id string, success bool);
Ich möchte alle Objekte abzufragen, die seit 5 Minuten „nicht bestanden“ (Erfolg = false) sind: alle Fall statusStream (, false) wo gibt es kein Ereignis (gleiche ID, wahr) innerhalb von 5 Minuten.
Was ist die einfachste Siddhi-Abfrage für diese Art von Job?
Zur Zeit habe ich:
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;