Reputation: 98
I am trying out WSO2 CEP for our new requirement. Currently i have written a query to find timedout events.
from InputStream#window.time(5 minutes) select * insert into TimeoutRequest for expired-events.
But my requirement is, the 5 minutes mentioned in time window will vary from each request. Some request should get timeout in 5 mins and some in 10 minutes. How to pass dynamic value for window.time(n minutes). If we can do via Custom Transformer or Custom Window, i am not getting the right context on how to do this.
Upvotes: 0
Views: 181
Reputation: 2757
There can be different approaches to implement this:
If there is only a limited set of time durations, you can simply define a window for each duration and point the incoming events to the relevant window using a filter. e.g:
from InputStream[timeoutValue == 5]#window.time(5 minutes) select * insert into TimeoutRequest for expired-events
from InputStream[timeoutValue == 10]#window.time(10 minutes) select * insert into TimeoutRequest for expired-events
Upvotes: 1