This documentation is for WSO2 CEP 3.0.0. View the home page of the latest release.

Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Introduction

This sample demonstrates how to set up an execution plan with a simple filter. It checks for delayed flights and adds related flight events to the stream named delayedFlightStream. This sample uses jms queues for processing.

The query used in this sample is as follows:

from flightStatsStream[status != 'On-Time']
select flightName, flightId, flightType, arrivalTime, trackNo
insert into delayedFlightStream  

Prerequisites

  1. See Prerequisites in CEP Samples Setup page.
  2. Copy the ActiveMQ JMS related JARs referred in JMS Transport to <CEP_HOME>/repository/components/lib directory.
  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

    • Also copy apache axiom.jar to <CEP_HOME>/samples/lib directory to send XML event types

    Start the ActiveMQ server before the CEP server starts.

Building the sample

Start the WSO2 CEP server with the sample configuration numbered 0103. 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/0103 (by default, the Axis2 repo is <CEP_HOME>/repository/deployment/server).

Executing the sample

  1. Open a new terminal, go to <CEP_HOME>/samples/consumers/jms and run the command below.

    ant queueConsumer -Dqueue=DelayedFlightStats (Since we are sending events from CEP to a topic called DelayedFlightStats)

    It builds the sample jms consumer and executes it.

    Do not close this terminal. It is required to keep the server running and receiving events.

  2. Open another terminal, go to <CEP_HOME>/samples/producers/flight-stats and run ant from there.

    It builds and runs the jms producer, which sends flight stats to the CEP server.

  3. From this terminal, see the details of the events sent.

    Note

    To configure queue use -Dqueue=xxxx

    For example : ant -Dqueue=FlightStats

  4. Also, see the output events received from the CEP via the terminal opened in step 1. For example,

  • No labels