WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This sample configuration creates the following.

  • Two streams with the IDs org.wso2.sample.login.info:1.0.0 and org.wso2.sample.login.count:1.0.0 

  • An event receiver named loginInfoReceiver

  • An event publisher named loginCountPublisher

  • An execution plan named LoginCountExecutionPlan

Executing the sample

Follow the steps below to execute the sample.

  1. Navigate to the <CEP_HOME>/samples/cep/producers/http/ directory, and execute the following Ant command using another tab in the CLI: ant -Durl=http://localhost:9763/endpoints/loginInfoReceiver -Dsn=0502

    This builds the HTTP client, and publishes the events defined in the <CEP_HOME>/samples/cep/artifacts/0502/loginInfoReceiver.txt file to the loginInfoReceiver endpoint.

    Note

    Do not close this terminal. It is required to keep the server running and receiving events.

    You view the CEP server receiving the output events in the logs of it in the CLI as shown below. 

    In the above output of events, the ipCount is incremented by one for each new event, and the totalCount is increased by the frequency of each event.

  2. Wait for CEP server to take a snapshot and persist.
  3. Restart the server and repeat step 1.

    You view the CEP server receiving the output events in the logs of it in the CLI as shown below.


    Info

    Event processing continues from the previous state even after you restart the server. The ipCount of the first event is displayed as 7 because you already sent 6 events in step 1. The totalCount is also calculated by considering the previous events as well.