Introduction
This sample demonstrates how to publish custom WSO2 events via WSO2Event 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 outgoing event. Events are generated using an input event file and the event simulator.
Prerequisites
Set up the prerequisites required for all samples.
Building the sample
Start the WSO2 DAS server with the sample configuration numbered 0058. For instructions, see Starting sample CEP configurations. This sample configuration does the following.
- Creates a stream with the ID
org.wso2.event.sensor.stream.map
:1.0.0
. - Creates an event publisher named
eventPublisher
. - Loads the events stored in the
<DAS_HOME>/samples/cep/artifacts/0058/eventsimulatorfiles/events.csv
file to the Event Simulator.
Executing the sample
Follow the steps below to execute the sample.
Navigate to the
<DAS_HOME>/samples/cep/consumers/wso2-event/
directory, and execute the following Ant command using another tab in the CLI:ant -Dsn=0058
The other optional parameters that can be used in the above command are defined in the<DAS_HOME>/samples/cep/consumers/wso2-event/build.xml
file.This builds the WSO2Event client that fetches the published events in the
<DAS_HOME>/samples/cep/artifacts/0058/eventsimulatorfiles/events.csv
file from theeventPublisher
endpoint as shown below.- Log into the DAS Management Console.
- Click Tools, and then click Event Simulator.
- Click Play on the corresponding event stream as shown below, to send the events in the
<DAS_HOME>/samples/cep/artifacts/0058/eventsimulatorfiles/events.csv
file to the publisher.
The WSO2 events that are published to the DAS server are logged in the consumer terminal as shown below.