Drools Fusion (CEP) Example and key concepts

Source: Internet
Author: User

Drools Fusion (Complex event processing) is the Drools for complex event handling modules, and it functions like Esper, both of which can provide event processing based on time span and sliding window, the biggest difference between the two is probably 1. Drools Open source, does not support distribution, syntax DRL, Esper has Enterprise Edition, support distribution, syntax class SQL

Look at the official documents.

http://docs.jboss.org/drools/release/5.6.0.Final/drools-fusion-docs/html_single/

Wrote a few examples

Https://github.com/zhwbqd/droolsCEP

Here's a look at some of the key concepts in drools fusion

1. The difference between event and fact

    1. An event is typically an immutable object
    2. Event is strongly correlated with time
    3. Event has a manageable life cycle (typically matching rules in a limited amount of time, facilitating engine management to automatically manage the event, destroying the mismatched event, and freeing up related resources)
    4. Each event has its own TS, which can be used to slide the time window, for example: statistic the average of the past 60min
2. Drools support two semantic event, point in time and interval (difference is whether the @duration annotation is 0) 3. Notes:1. @role default fact, CEP time @role (event) identifies fact as an event
2. @timestamp, each event has a related timestamp, which is obtained from the system by default (that is, the time to insert the session), or it can be assigned externally3. @duration, the duration of each event is 0 in Point-in-time event, and the default value is 0, externally assignable
4. @expire, only valid in stream mode, expiration time of event, @expire 300s expiration @expire (1d3h45m20s29ms) 1 days 3 hours 45 minutes 20 seconds 29 milliseconds expired
 4. Sessionclock A total of 4, mainly used in two kinds, realtime and pseudo5. After, before, During, Meet and other keywords are used to compare the occurrence of two events in chronological orderlike the meaning of the Before keyword.
This

6. Sliding Window can only run in stream mode, Slidingwindow will perform the operation immediately, and will not wait until the event satisfies the requirement to calculate, the event is not in the Sliding Window matches will not be destroyed, there may be other event dependent on it, it will expire within its own expire time

Drools Fusion (CEP) Example and key concepts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.