Drools Fusion Out of Order events

192 views Asked by At

I am using Drools fusion for processing real time events. Each event has a timestamp field. Issue is events can be out of order sometimes. Can drools fusion handle this situtation and if yes how ?

Thanks

1

There are 1 answers

7
laune On

If A is stamped 0:00:00 and B is stamped 0:01:00 and B arrives and you have the rule

rule "A before B"
when
    $b: B()
    not A( this before $b )
then ... end

it will fire.

You can use fact insertion time as a timestamp.

Keep the original timestamp as a property. Maybe you'll want to look at it if a "situation" occurs. It depends.

Addition If you have a maximum delay dt you can put all arriving events into "quarantine" for this delay. Before you insert A, check all other streams (sources) for an event B that precedes A and react accordingly. Everything will react at least delayed by dt.