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
- An event receiver named
wsReceiverto fetch events from the configured receiver email address
- An event publisher named
loggerEventPublisherto 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
This builds the WebSocket client and publishes the events in the
<CEP_HOME>/samples/cep/artifacts/0019/sensorStreamEvents.txtfile to the
wsReceiverendpoint. 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.