Thursday, May 19, 2016

Use siddhi Try it for Experimentation

This blog post explains how to use Siddhi Try It tool which comes with WSO2 CEP 4.2.0. The Siddhi Try It is a tool used for experimentation of event sequences through Siddhi Query Language (SiddhiQL) statements in real time basis. You can define an execution plan to store the event processing logic and input an event stream to test the Siddhi query processing functionality.

Follow the steps below to use the Siddhi Try It tool.

Step 1

Download product from here and start the server (<CEP_HOME>/bin/ For more Getting Started with WSO2 CEP.

Step 2

Log in to the CEP management console, click Tools, and then click Siddhi Try It as shown above. You will get a window like shown below.

Step 3

Execution plan : WSO2 CEP uses Execution Plans to store event processing logic. An Execution Plan is bound to an instance of the Siddhi complex event processing run-time, which is responsible for the actual processing of the events. The event processor allows users to configure multiple Execution Plans where by providing multiple isolated event processing environments per Execution Plan. A typical Execution Plan consists of a set of queries and related input and output Event Streams. for more..

Create the execution plane as described in below image. When defining more than one query each query need to have semicolon. Defining a query name (e.g. query1) is optional.

Step 4

Event Stream: it's a logical series of events ordered based on the time. it will contain input stream and the time stamp to begin the process of sending events for Begin Time if required.

If the Execution need to start with the current time stamp we no need to set the
Begin Time unless we need to set the time stamp. Input stream need to create like described on the above image. Input stream can contain a delay between events. When defining a delay, enter the delay time in milliseconds. (eg : delay(100) uses for delay the stream for a 100 milliseconds). Finally click submit button.

Furthermore, for scheduler related queries, you need to set up a delay with a necessary time in the event stream. For more information on event streams, see Working with Event Streams.

Step 5

Input stream and the results of the execution plan under the defined output stream, separated query outputs are shown below.