Introduction
This sample demonstrates how to filter incoming event attributes and add them to another topic using simple pass-through with JMS adaptor and HTTP adaptor. Because we do not use any execution plan here, there is no Siddhi query.
Prerequisites
- See Prerequisites in CEP Samples Setup page.
- Copy the ActiveMQ JMS related JARs referred in JMS Transport to
<CEP_HOME>/repository/components/lib
directory. - Copy the following JARs from ActiveMQ distribution directory to
<CEP_HOME>/samples/lib
directory.<ActiveMQ_HOME>/activemq-all-5.7.0.jar
<ActiveMQ_HOME>/lib/ geronimo-jms_1.1_spec-1.1.1.jar
Start the ActiveMQ server before the CEP server starts.
Building the sample
Start the WSO2 CEP server with the sample configuration numbered 0003. For instructions, see Starting sample CEP configurations. This sample configuration does the following:
- Creates
<CEP_HOME>/repository/conf/stream-manager-config.xml
file, which is used to create the stream definitions for the sample. - Points the default Axis2 repo to
<CEP_HOME>/sample/artifacts/0003
(by default, the Axis2 repo is<CEP_HOME>/repository/deployment/server
).
Executing the sample
Open a new terminal, go to
<CEP_HOME>/samples/consumers/generic-log-service
and run the following command:ant -DsampleNo=0003
It builds the sample log service and deploys it in the webapps directory that is relevant to the sample. After proper deployment, the web application can receive messages sent from the CEP server.
Note the logs in the CEP server when GenericLogService.war is deploying. For example,
Open another terminal, go to
<CEP_HOME>/samples/producers/purchase-info
and run ant from there.It builds and runs the jms producer, which sends purchase data to the CEP server.
From this terminal, view the details of the events sent. For example,
Go to the console output of the CEP server and note the events received after processing. For example,