This documentation is for WSO2 CEP 4.0.0. View the home page of the latest release.

Skip to end of metadata
Go to start of metadata

WSO2 CEP uses storm based distributed execution plan to store the processing logic to be used in a distributed mode deployment.

Writing an execution plan

The procedure for creating an execution plan is the same as that in Creating a Standalone Execution Plan. In addition, the following annotations are used in the Siddhi queries.

@dist (parallel='<number of Storm tasks>)The number of storm tasks in which the query should be run parallel.@dist(parallel='4')
@dist(execGroup='name of the group')

All the Siddhi queries in a particular execGroup will be executed in a single Siddhi bolt.

@Plan:dist(receiverParallelism='number of receiver spouts') The number of event receiver spouts to be spawned for the Storm topology.@Plan:dist(receiverParallelism='1')
@Plan:dist(receiverParallelism='number of publisher bolts') The number of event publisher bolts to be spawned for the Storm topology.@Plan:dist(publisherParallelism='4')


The following execution plan is populated with the above mentioned annotations.

Every Siddhi query in a particular execGroup should have the same number of tasks as shown in the execution plan above ( e.g., parallel = '4' ). If the queries need to be distributed across different siddhi bolts, the execGroup names of the queries should differ from each other.

Please note that the number of execution plans that can be deployed is bounded by the number of workers in storm topology. Each topology will require at least one worker process. We can also specify the number of workers per topology by setting topology.workers in <CEP_HOME>/repository/conf/cep/storm/storm.yaml, in such case for an example if the storm cluster has 10 workers and topology.workers is set to 2. There there can be only 5 execution plans at most.

When adding RDBMS event tables please use below notation to define event tables as datasource based approach does not work with Storm.

@From(eventtable='rdbms', jdbc.url='jdbc:mysql://localhost:3306/cepdb', username='root', password='root','com.mysql.jdbc.Driver','RoomTable')


See the following samples for more information.  

  • No labels