This sample demonstrates the usage of the UI publisher using a client app. This sample does not have Siddhi queries because it does not not use any execution plans.
Set up the prerequisites required for all samples
Building the sample
Start the WSO2 CEP server with the sample configuration numbered 0071. For instructions, see Starting sample CEP configurations. This sample configuration does the following.
Creates an event stream named
Creates an event publisher named
Loads the events stored in the
<CEP_HOME>/samples/cep/artifacts/0071/eventsimulatorfiles/events.csvfile to the event simulator.
- Deploys a Jaggery application named
outputuitest. This application functions as the client that consumes the events published by the UI publisher.
Executing the sample
Follow the steps below to execute the sample.
- Access the Analytics Dashboard using the following URL.
Access the the following page.
This opens the following form with the fields filled in with default values as shown below.
The fields in the form are described in the table below.
Field Name Description Default Value Stream Name The name of the event stream to which you want to subscribe. When events with values for the attributes defined in this stream are received by the Output Adapter UI test application.
Version The version of the event stream to which you want to subscribe.
CEP Host The host on which the CEP server (which contains the UI publisher) runs.
CEP Port The port on which the CEP server (which contains the UI publisher) runs.
UI publisher supports two types of subscriptions named
HTTP. If you select
Websocketfor this field, the client application receives events via the Websocket transport. If you select
HTTPfor this field, the client application receives events via the HTTP transport.
HTTPsubscription is used, the events are polled from the UI publisher at a constant interval, and this interval needs to be specified in the Polling Interval field.
The time interval at which events should be polled from the UI publisher. This time interval is specified in seconds.
This field value is only applicable is the value specified in the Mode field is
- Click Connect. Now the client app is ready to receive events. Next step is sending events so the UI publisher receives them and publishes them to the client application.
- Log into the WSO2 CEP Management Console.
- In the Tools tab, click Event Simulator.
- Click Play on the corresponding event stream as shown below to send the events in the
<CEP_HOME>/samples/cep/artifacts/0071/eventsimulatorfiles/events.csvfile to the publisher.
The output events published from WSO2 CEP and received by the client Jaggery application are logged as follows.