Versions Compared

Key

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

...

This sample demonstrates how to filter some incoming event attributes and add them to another topic using simple pass-through with JMS adaptor adapter and WS-Event-Local adaptoradapter. Because we do not use any execution plan here, there is no Siddhi query.

...

  1. See Prerequisites in CEP Samples Setup page.
  2. If you use ActiveMQ, add the following Copy the ActiveMQ JMS related JARs from ActiveMQ distribution directory referred in JMS Transport to <CEP_HOME>/repository/components/lib directory. Also see JMS Transport for more information about required JARs
  3. 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

    Note

    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

  1. Open another terminal and switch a new terminal, go to <CEP_HOME>/samples/consumers/log-service and run the below command. This will build the sample run the following command:

    Info

    ant -DsampleNo=0003

    It builds the axis2 sample log service and deploy deploys it in the axis2 repository that is relevant to the specified sample. After proper deployment, the web service will be able to Web service can receive messages sent from the CEP server. Below you can see

  2. Note the logs in the CEP server when LogService.aar is deploying. For example,

    Info

    ant -DsampleNo=0003

    Image Removed

    Then, We need to Configure the LogService in order to receive the output events emitted by

    Image Added

  3. Create PurchaseOrders topic in the local broker and subscribe LogService on that topic.

    It enables the LogService to receive output events from the CEP server under the PurchaseOrders topic. Here we will be creating PurchaseOrders topic in the local broker and subscribe  LogService on that topic.Click on "Add" menu item under "Topics" Menu in Manage section of the left panel. Then Specify the topic name in the topic input text box, in this case topic name is : "PurchaseOrders" PurchaseOrders topic.
  4. Log in to the CEP management console and click the Add menu under Topics menu.
  5. Provide the topic name as PurchaseOrders (the output topic) and click on 'Add Topic' button. This will add . It adds the topic to the server and you will be directed to the Topic Browser page.
    Once you click on the topic in topic browser page you will be able see four links as in the bellow image. Click in the subscribe link and you will be directed
  6. to Subscribe pageThe Topic Browser page opens with the topic created before. Click the Subscribe link associated with it.
  7. The Subscribe page opens. Create subscription with following details. Once you are done click the Subscribe button.
    Image RemovedNow subscription to the specific topic is done. Now we can :
    Image Added
    You are now subscribed to the topic and ready to send events to the CEP. 

  8. From Open another terminal switch , go to <CEP_HOME>/samples/producers/purchase-info/ and run ant from there. This will build and run

    It builds and runs the jms producer, which will send some sends purchase information data to the CEP server.

  9. From this terminal, you will be able to view the details of the events sent. Below is the sample screen shot when sending events.For example,

  10. Below is Go to the console output in of the CEP server when and note the events are received after processing.  For example,

    Image RemovedImage Added