Versions Compared

Key

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

For information on understanding the general flow of WSO2 CEP samples, see WSO2 CEP Samples. The following sections explain the generic setup instructions to execute the samples.

...

SampleRequirements
All samples
JMS related samples

The JMS samples are explained to be tried out using following JMS providers

MQTT related samples

The MQTT samples are explained to be tried out using following MQTT-supported servers

Kafka related samples

The Kafka samples are explained to be tried out using following Kafka Broker versions

WebSocket related samples

Java Development Kit / JRE version 1.7.*

Apache Storm related samples

Apache Storm version 0.9.3 or later (to run Storm samples.)

...

Excerpt

To start the CEP with a sample configuration, run the following command with -sn <n>, where <n> denotes the number assigned to the sample.

Code Block
On Linux:	./wso2cep-samples.sh -sn <n>
On Windows:	wso2cep-samples.bat -sn <n> 

For example, to start the CEP with the configuration of sample 0101, run the following command inside <CEP_HOME>/bin directory:

Code Block
On Linux: 	./wso2cep-samples.sh -sn 0101 
On Windows:	wso2cep-samples.bat -sn 0101

The <CEP_HOME>/samples/artifacts directory contains the sample configurations of CEP. Each configuration is inside a sub directory by the name of the sample numbered <n>. For example, the cep artefacts for sample 0101 is inside<CEP_HOME>/samples/artifacts/0101 directory.

In the normal mode the <CEP_HOME>/bin/wso2server.bat or  <CEP_HOME>/bin/wso2server.sh  script starts an instance of the CEP using the configuration files  in <CEP_HOME>/repository/deployment/server directory and any sample configurations passed in as -sn <n> is ignored.

Info
Point the

These configurations on running the samples do the following:

  • Create <CEP_HOME>/repository/conf/data-bridge/stream-definitions.xml file, which is used to create the stream definitions for the sample.

  • point the default Axis2 repo to <CEP_HOME>/sample/artifacts/<SAMPLE_NUMBER>/ directory. (<CEP_HOME>/repository/deployment/server/ directory is used as the default Axis2 repo.)

    Starting sample consumers

    Each sample consumer service is saved in a separate directory as <CEP_HOME>/samples/consumers/<consumer_name>.

    1. To start a sample consumer, go to its directory <CEP_HOME>/samples/consumers/<comsumer_name> and type ant. For example,

      Code Block
      user@host:/tmp/wso2cep-34.1.0/samples/consumers/wso2-event$ ant
      Buildfile: /home/user/tmp/wso2cep-34.1.0/samples/consumers/wso2-event/build.xml
      ...
      run:[echo] To configure host, port and events use -Dhost=xxxx -Dport=xxx -Devents=xx
       [echo] Sending to : http://localhost:7661
                  
       [java] Test Server starting on 10.100.0.75
       [java] Thrift Server started at 10.100.0.75
       [java] Thrift SSL port : 7761
       [java] Thrift port : 7661
       [java] Test Server Started
      Info

      To write a custom wso2Event data publisher (Thrift data publisher), use the pom file given here .

    2. Deploy the log service sample consumer, which is a Web service, by specifying the sample number as follows:

      Code Block
      ant -DsampleNo=<sample no>
      Info

      Running DsampleNo ant script deploys the log service in the axis2 repository that is relevant to the specified sample. After proper deployment, the Web service is able to receive messages from the CEP server.

      Code Block
      user@host:/tmp/wso2cep-34.1.0/samples/consumers/logService$ ant -DsampleNo=0102
      Buildfile: /home/usre/tmp/wso2cep-3.0.0/samples/consumers/logService/build.xml
      -folder.check:
      -assign.sample:
       [echo] Sample No : 0102
       [echo] Services Dir : ../../../samples/artifacts/0102/axis2services
      -assign.main:
      folder.set:
      clean:
      ...
      [jar] Building jar: /tmp/wso2cep-34.1.0/repository/deployment/server/webapps/logService.war
      BUILD SUCCESSFUL
      Total time: 0 seconds

    ...

    1. Go to the sample producer's directory <CEP_HOME>/samples/producers/<producer_name> and type ant with relevant input arguments. For example,

      Code Block
      user@host:/home/user/wso2cep-34.1.0/samples/producers/pizza-shop$  ant pizzaOrderClient -Dservice=WSEventLocalAdaptorService 
      -DtopicName=BatchedPizzaOrder -DbatchedEvents=true
      Buildfile: /home/user/tmp/wso2cep-34.1.0/samples/producers/pizza-shop/build.xml
      init:
      compile:
      [copy] Copying 1 file to /home/user/tmp/wso2cep-34.1.0/samples/producers/pizza-shop/temp/classes
      pizzaOrderClient:
      [echo] To configure host and port use -Dhost=xxxx -Dport=xxx -Dservice=xxx -DtopicName=xxx
      [echo] Sending to : http://localhost:9763/services/WSEventLocalAdaptorService/BatchedPizzaOrder
                  
      [echo] To send events in batches use -DbatchedEvents=true
      [echo] Sending events in batches : true
      BUILD SUCCESSFUL
      Total time: 1 second

    ...

    Info
    Previous Apache ActiveMQ versions may not contain SLF4J related files in the client JAR. Therefore, if you get an error, add  SLF4J related JAR file to<CEP_HOME>/samples/lib/ directory of the samples.

    ...

    Before you run MQTT samples, set up and start a MQTT-supported server. Configure MQTT sample clients by copying relevant MQTT client libraries to <CEP_HOME>/samples/lib folder as mentioned below.

    ...

    Before you run Kafka samples, set up and start a Kafka broker. Configure Kafka sample clients by copying relevant Kafka client libraries to <CEP_HOME>/samples/lib folder as mentioned below.

    ...