This sample demonstrates how to receive incoming custom JSON events via the HTTP transport. Custom events are events with custom mappings that do not adhere to the default event formats. For more information on event formats, see Event Formats. This sample does not process the incoming events. The 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 0002. For instructions, see Starting sample CEP configurations. This sample configuration does the following:
- Changes the default Axis2 repo from
- Creates an event stream named
- Creates an event receiver named
httpReceiverwith custom mapping.
- Creates an event publisher named
httpLoggerto log the received messages.
Executing the sample
Open another tab in the CLI, and issue the following
ant command from the
It builds the http client and publishes the events in the
<CEP_HOME>/samples/cep/artifacts/0002/httpReceiver.txt to the
httpReceiver endpoint. You can view the details of the events that are sent as shown in the log below.
Events received by WSO2 CEP are logged as follows.