CEP 是我需要的吗(系统状态和事件重播)

发布于 2024-10-17 03:39:50 字数 616 浏览 2 评论 0原文

我正在寻找 CEP 引擎,但我不知道是否有任何引擎满足我的要求。 我的系统必须处理多个事件数据流并生成复杂的事件,这正是几乎任何 CEP 引擎都完美适合的(ESPER、Drools)。

我将所有原始事件存储在数据库中(这不是 CEP 部分,但我这样做)并使用规则(或连续查询或其他内容)来生成对复杂事件的自定义操作。但我的一些规则取决于过去发生的事件。 例如:每次我的配偶来或离开家时,我都可以让传感器发送事件,如果我的车和我喜欢的女人的车都在房子附近,我会收到短信“危险”。

问题是,随着事件处理服务的重新启动,我丢失了有关系统状态的所有信息(我的妻子在家吗?)并且要恢复它,我需要在未知的时间内重播事件。系统状态不仅取决于原始事件,还取决于复杂事件。

当我需要一些关于过去复杂事件的报告时,也会出现同样的问题。我将原始事件数据存储在数据库中,并且可以生成这些重播原始事件的复杂事件,但我不知道我必须重播它们的确切时间段。

同时很明显,对于大多数规则来说,可以自动查找过去(或加载要处理的事件的时间段)要处理的事件数量以恢复系统状态。 如果给定的操作取决于我妻子是否在家,则 CEP 系统必须请求最后的状态更改。如果要求报告复杂事件,并且复杂事件取决于上一期间的平均价格,则应重播该期间的所有价格变化事件。等等...

如果我错过了什么?

I'm looking for a CEP engine, but I' don't know if any engine meets my requirements.
My system has to process multiple streams of event data and generate complex events and this is exactly what almost any CEP engine perfectly fits (ESPER, Drools).

I store all raw events in database (it's not CEP part, but I do this) and use rules (or continious queries or something) to generate custom actions on complex events. But some of my rules are dependent on the events in the past.
For instance: I could have a sensor sending event everytime my spouse is coming or leaving home and if both my car and the car of my fancy woman are near the house, I get SMS 'Dangerous'.

The problem is that with restart of event processing service I lose all information on the state of the system (is my wife at home?) and to restore it I need to replay events for unknow period of time. The system state can depend not only on raw events, but on complex events as well.

The same problem arises when I need some report on complex events in the past. I have raw events data stored in database, and could generate these complex events replaying raw events, but I don't know for which exactly period I have to replay them.

At the same time it's clear that for the most rules it's possible to find automatically the number of events to be processed from the past (or period of time to load events to be processed) to restore system state.
If given action depends on presence of my wife at home, CEP system has to request last status change. If report on complex events is requested and complex event depends on average price within the previous period, all price change events for this period should be replayed. And so on...

If I miss something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

灼痛 2024-10-24 03:39:50

如果我没记错的话,RuleCore CEP Server 可能会解决您的问题。如果您重新启动它,它不会丢失状态,并且它包含一个虚拟逻辑时钟,以便您可以使用任何时间概念重播事件。

The RuleCore CEP Server might solve your problems if I remember correctly. It does not lose state if you restart it and it contains a virtual logical clock so that you can replay events using any notion of time.

烟雨凡馨 2024-10-24 03:39:50

我不确定您的问题是否是当前的 CEP 产品是否提供将历史数据与实时事件连接起来,但如果这是您所需要的,Esper 允许您从 JDBC 源(它将您的历史数据与实时事件连接起来)提取数据并反映它们出现在你的 EPL 声明中。我想您已经检查了 Esper 网站,如果没有,您会发现 Esper 拥有出色的文档,其中包含大量食谱示例

但即使您在现场事件之后对历史事件进行建模,也无法解决选择正确时间范围的问题,正如您所写,这个时间范围取决于用例。

I'm not sure if your question is whether current CEP products offer joining historical data with live events, but if that's what you need, Esper allows you to pull data from JDBC sources (which connects your historical data with your live events) and reflect them in your EPL statements. I guess you already checked the Esper website, if not, you'll see that Esper has excellent documentation with lots of cookbook examples

But even if you model your historical events after your live events, that does not solve your problem with choosing the correct timeframe, and as you wrote, this timeframe is use case dependent.

高跟鞋的旋律 2024-10-24 03:39:50

正如前面的人提到的,我认为你的问题并不是真正的引擎问题,而更多的是用例问题。我熟悉的所有引擎,包括 Drools Fusion 和 Esper 都可以将传入事件与从外部源(如数据库)按需查询的历史数据和/或状态数据结合起来。在我看来,您需要做的是在发生相关更改时保留状态(或“时间戳检查点”),并在重新启动时重新加载状态,而不是在未知的时间范围内重播事件。

或者,如果使用 Drools,您可以检查现有规则(对您的规则/查询的反映),以找出您的规则需要哪些类型的事件,并回溯您的事件日志,直到满足所有要求并加载/重播的时间点使用会话时钟从那里开始您的活动。

最后,您可以使用集群来减少重新启动次数,但这并不能解决您所描述的问题。

希望有帮助。

As previous people mentioned, I don't think your problem is really an engine problem, but more of a use case one. All engines I am familiar with, including Drools Fusion and Esper can join incoming events with historical data and/or state data queried on demand from an external source (like a database). It seems to me that what you need to do is persist state (or "timestamp check-points") when a relevant change happens and re-load the state on re-starts instead of replaying events for an unknown time frame.

Alternatively, if using Drools, you can inspect existing rules (kind of reflection on your rules/queries) to figure out which types of events your rules need and backtrack your event log until a point in time where all requirements are met and load/replay your events from there using the session clock.

Finally, you can use a cluster to reduce the restarts, but that does not solve the problem you describe.

Hope it helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文