Unknown macro: {next_previous_links}
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 8 Next »

Introduction

This sample demonstrates how to create an event table and use it.

The execution plan used in this sample is as follows:

from orderStream unidirectional join pizzaOrdersTable on pizzaOrdersTable.customerName == orderStream.customerName select orderStream.customerName as customerName, pizzaOrdersTable.noOfOrders as noOfPreviousOrders, pizzaOrdersTable.lastOrderedTime as lastOrderedTime insert into previousOrders;

from previousOrders select noOfPreviousOrders as noOfOrders, customerName update pizzaOrdersTable on pizzaOrdersTable.customerName == customerName;

The first query,

  • Receives events through the orderStream.

  • Take the previous order details of the customer.

  • Insert the data into previousOrders table.

The second query,

  • Update the pizzaOrdersTable according to the previousOrders table.

  • This sample 

This samples outputs custom text events using a logger event publisher. Custom events are events with custom mappings that does not adhere to the default event formats. For more information on event formats, see Event Formats

Prerequisites

See Prerequisites in CEP Samples Setup page.

Building the sample

Start the WSO2 CEP server with the sample configuration numbered 0116. For instructions, see Starting sample CEP configurations. This sample configuration does the following:

  • Points the default Axis2 repo to <CEP_HOME>/sample/artifacts/0116 (by default, the Axis2 repo is <CEP_HOME>/repository/deployment/server).

Executing the sample

  1. Open another terminal, go to <CEP_HOME>/samples/producers/http and run the following command:

  2. ant -Durl=http://localhost:9763/endpoints/pizzaOrderEventReceiver -Dsn=0116

  3. It builds the http client and publishes the events at  <CEP_HOME>/samples/artifacts/0116/pizzaOrderEvents.txt to the pizzaOrderEventReceiver http endpoint.

  4. You can see the events getting received by CEP by the logs in its console

  • No labels