Esper - detect absence of a certain event

▼魔方 西西 提交于 2019-12-11 14:34:50

问题


is it possible to detect the absence of a certain event type within a given time window without using any other event types in Esper?

Thanx ;)


回答1:


You can take a look at the solution patterns here for some ideas: http://www.espertech.com/esper/solution-patterns#absence-1

Here is an adapted example of detecting an absence of an event, after it has been fired once:

select * from pattern [every EventX -> (timer:interval(10 sec) and not EventX)];

This will fire only once, if after an EventX is received, no other EventX arrives within 10 seconds...

This example:

select * from pattern [every (timer:interval(10 sec) and not EventX)];

Will fire every 10 seconds if no EventX has been receive during that time (and keep firing like this forever).




回答2:


Outer joins are also a good way to detect the absence of an event.



来源:https://stackoverflow.com/questions/31796373/esper-detect-absence-of-a-certain-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!