This sample demonstrates how to receive custom incoming WSO2 event objects via the WSO2Event receiver and then map a few attributes with different names. Custom events are events with custom mappings that do not adhere to the default WSO2 Event format. For more information on event formats, see Event Formats. WSO2Event receiver is implemented based on Apache Thrift. This sample does not process the incoming events. A log event publisher is used to log the received events, and to verify the messages.
Set up the prerequisites required for all samples.
Building the sample
Start the WSO2 CEP server with the sample configuration numbered 0008. For instructions, see Starting sample CEP configurations. This sample configuration does the following:
Changes the default Axis2 repo from
Creates the event streams
Creates an event receiver named
Creates an event publisher named
wso2eventLoggerto log the received messages.
Executing the sample
Open a new tab in the CLI and issue the following
ant command from the
This builds the
wso2event client and publishes the events in the
<CEP_HOME>/samples/cep/artifacts/0008/org_wso2_event_sensor_stream_1_0_0.csv file to the
wso2eventReceiver endpoint. You can view the details of the events that are sent as shown in the log below.
The events received by WSO2 CEP are logged as shown below.
Note the following in the above log.
- The events received are being mapped to a new stream named
- In the event stream
data:1.0.0, the attribute named
sensorNamehas been dropped. The attributes
sensorValueare mapped to two different attributes named