Skip to content
Carlos Rodríguez edited this page Apr 11, 2016 · 4 revisions

The core engine of redborder CEP is called Siddhi 3.0.X. It is a java library made by WSO2 that lets you combine, analyze and extract data from a set of streams in real-time. Every time an event is received from a kafka topic specified on the config file, the event is passed and processed by Siddhi. The output of this processing is then inserted into an user-specify kafka topic.

This page will describe some basic concepts about Siddhi, but you will need some knowledge about Siddhi and Siddhi Query Language if you want to get the full power of it. For more information about Siddhi you can visit its official documentation at WSO2's site.

Execution plans

The unit of work of Siddhi is called an execution plan. These plans describes what Siddhi will do with which streams, and where the result of this processing will be inserted. These execution plans are written in a language called Siddhi Query Language and are composed of a serie of statements separated with a semicolon.

Execution plans are usually composed of two parts: the streams definition and the queries:

Stream definition

The streams definition defines the streams that Siddhi will use. Fortunately, we take care of them for you! redborder CEP will define on each execution plan a Siddhi Stream from every Kafka topic specified on your config file, so you can forget about them.

Queries

The queries is the main thing that you will be writing. For more information about Siddhi Queries follow this link.

An example of an execution plan specified on a redborder CEP rule will be the following:

from clicks#window.length(10) select avg(clicks) as avgClicks insert into clicksAverages

A rule with this execution plan would insert for every clicks event a new event into the topic clicksAverages with the average of the click attribute from the last ten clicks events.

IMPORTANT NOTE: Each redborder CEP rule has its independent execution plan. That means that execution plans from different rules can't interact between them, and that adding or removing rules does not affect the rest of rules already present on the system.

Clone this wiki locally