Prerequisites
Set up the prerequisites required for all samples.
Building the sample
Start the WSO2 CEP server with the sample configuration numbered 0019. For instructions, see Starting sample CEP configurations. This sample configuration creates the following.
- An event stream with the ID
org.wso2.event.sensor.stream:1.0.0
- An event receiver named
wsReceiver
to fetch events from the configured receiver email address - An event publisher named
loggerEventPublisher
to log the received messages
Executing the sample
Navigate to the
<CEP_HOME>/samples/cep/producers/websocket/
directory, and execute the following Ant command using another tab in the CLI:ant -Dport=9099 -Dsn=0019
The other optional parameters that can be used in the above command are defined in the
<CEP_HOME>/samples/cep/producers/websocket/build.xml
file.This builds the WebSocket client and publishes the events in the
<CEP_HOME>/samples/cep/artifacts/0019/sensorStreamEvents.txt
file to thewsReceiver
endpoint. You view the details of the events that are sent as shown below.
- Start the WSO2 CEP server with the sample configuration numbered 0019. For instructions, see Starting sample CEP configurations.
The CEP server receiving the JSON events is logged in the CLI as shown below.