WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.
Skip to end of metadata
Go to start of metadata


This sample demonstrates how to receive incoming JSON events that adhere to the WSO2 Event format via the HTTP transport. This sample does not process the incoming events. A log event publisher is used to log the received events, and to verify the messages.

Instead of using logger publishers, you can also use the Event Tracer or Event Metrics to monitor received and published events as well as the memory consumption of each execution plan.


Set up the prerequisites required for all samples.

Building the sample 

Start the WSO2 CEP server with the sample configuration numbered 0001. For instructions, see Starting sample CEP configurations. The sample configuration does the following.

  • Creates an event stream named
  • Creates an event receiver named httpReceiver.
  • Creates an event publisher named name httpLogger to log the received messages.

Executing the sample

Open a new tab in the CLI and execute the following ant command from the <CEP_HOME>/samples/cep/producers/http/ directory.

ant -Durl=http://localhost:9763/endpoints/httpReceiver -Dsn=0001

The other optional parameters that can be used in the above command are defined in the <CEP_HOME>/samples/cep/producers/http/build.xml file.

This builds the HTTP client and publishes the events in the <CEP_HOME>/samples/cep/artifacts/0001/httpReceiver.txt file to the httpReceiver endpoint.  You can view the details of the events that are sent as shown in the log below.

events being published to the endpoint

The logs of the JSON events received by the CEP server will be displayed in the CLI as shown in the example below.

  • No labels