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.
...
Sample | Requirements |
---|---|
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.
For example, to start the CEP with the configuration of sample 0101, run the following command inside
The In the normal mode the
|
Starting sample consumers
Each sample consumer service is saved in a separate directory as <CEP_HOME>/samples/consumers/<consumer_name>
.
To start a sample consumer, go to its directory
<CEP_HOME>/samples/consumers/<comsumer_name>
and typeant
. 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 .
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
...
Go to the sample producer's directory
<CEP_HOME>/samples/producers/<producer_name>
and typeant
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.
...