Introduction
This sample demonstrates how to filter incoming event attributes and add them to another topic using simple pass-through with JMS adaptor and WS-Event-Local adaptor. Because we do not use any execution plan here, there is no Siddhi query.
Prerequisites
- See Prerequisites in CEP Samples Setup page.
- If you use ActiveMQ, add the following JMS related JARs from ActiveMQ distribution directory to
<CEP_HOME>/repository/components/lib
directory. Also see JMS Transport for more information about required JARs.<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/log-service
and run the following command:ant -DsampleNo=0003
It builds the axis2 sample log service and deploys it in the axis2 repository that is relevant to the sample. After proper deployment, the Web service can receive messages sent from the CEP server.
Note the logs in the CEP server when LogService.aar is deploying. For example,
- Create
PurchaseOrders
topic in the local broker and subscribeLogService
on that topic.
It enables theLogService
to receive output events from the CEP server under thePurchaseOrders
topic. - Log in to the CEP management console and click the Add menu under Topics menu.
- Provide the topic name as
PurchaseOrders
(the output topic) and click Add Topic. It adds the topic to the server and you will be directed to the Topic Browser page. - The Topic Browser page opens with the topic created before. Click the Subscribe link associated with it.
- The Subscribe page opens. Create subscription with following details:
You are now subscribed to the topic and ready to send events to the CEP. 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,