Introduction
This sample demonstrates how to receive custom incoming text events via file tail transport. Custom events are events with custom mappings that does not adhere to the default event formats. For more information on event formats, see Event Formats. This sample does not do any processing on the incoming event. The log event publisher is used to log the received events, and to verify the messages.
Prerequisites
Set up the prerequisites required for all samples.
Building the sample
Start the WSO2 CEP server with the sample configuration numbered 0017. For instructions, see Starting sample CEP configurations. This sample configuration creates the following.
- A stream named
org.wso2.event.sensor.stream:1.0.0.
- An event receiver named
fileReceiver.
- An event publisher named
httpLogger
to log the received messages.
Executing the sample
Open another terminal console window and navigate to the <CEP_HOME>/samples/cep/artifacts/0017
directory. Then execute following command to write data to the file.
echo "timestamp:19900813115534,isPowerSaverEnabled:false,sensorId:103,sensorName:temperature,longitude:20.44345,latitude:5.443435,humidity:8.9,sensorValue:1.23434" >> fileReceiver.txt
CEP console will show the received event as following screenshot.