Introduction to Oracle Complex Event Processing

Oracle Complex Event Processing, or Oracle CEP for short, is a low latency, Java based middleware framework for event driven applications. It is a light weight application server which connects to high volume data feeds and has a complex event processing engine (CEP) to match events based on user defined rules.

Oracle CEP has the capability of deploying user Java code (POJOs) which contain the business logic. Running the business logic within Oracle CEP provides a highly tuned framework for time and event driven applications.

Conceptual Overview of Oracle CEP

The following graphic provides a high level view of an event-driven system:

An event-driven system is generally comprised of several event sources, the real-time event-driven (Oracle CEP) applications, and event sinks. The event sources generate streams of ordinary event data. The Oracle CEP applications listen to the event streams, process these events, and generate notable events. Event sinks receive the notable events.

Event sources, event-driven applications, and event sinks are de-coupled from each other; one can add or remove any of these components without causing changes to the other components. This is an attribute of event driven architectures.

Event-driven applications are rule-driven. These rules, or queries, which are persisted using some data store, are used for processing the inbound stream of events, and generating the outbound stream of events. Generally, the number of outbound events is much lower than that of the inbound events.

Oracle CEP is a middleware for the development of event-driven applications. An Oracle CEP application is essentially an event-driven application.

Next, consider the application itself, which is hosted by the Oracle CEP infrastructure, a light-weight container. It can be described by the following diagram:

An Oracle CEP application typically comprises of four main component types. Adapters interface directly to the inbound event sources. Adapters understand the inbound protocol, and are responsible for converting the event data into a normalized data that can be queried by a processor (i.e. event processing agent, or processor). Adapters forward the normalized event data into Streams. Streams are event processing endpoints. Among other things, streams are responsible for queuing event data until the event processing agent can act upon it. The event processing agent removes the event data from the stream, processes it, and may generate new events to an output stream. The user code registers to listen to the output stream, and is triggered by the insertion of a new event in the output stream. The user code is generally just a plain-old-Java-object (POJO). The user application makes use of a set of external services, such as JMS, WS, and file writers, to forward on the generated events to external event sinks.

Event Processing Networks

Adapters, streams, processors, and business logic POJOs can be connected arbitrarily to each other, forming event processing networks (EPN). Examples of topologies of EPNs are:

Adapter > Stream > Business Logic POJO

Scenario: no processing is needed, aside adaptation from proprietary protocol to some normalized model.

Scenario: two layers of event processing, the first processor creates causality between events, and the second processor aggregates events into complex events.

EPNs have two important attributes.

First, event processing networks can be used to create hierarchy of processing agents, and thus achieve very complex processing of events. Each layer of the EPN aggregates events of its layer into complex events that become simple events in the layer above it.

A second attribute of event processing networks is that it helps with integrability, that is, the quality of having separately developed components work correctly together. For example, one can add user code and reference to external services at several places in the network.

Use Cases

The use cases for Oracle CEP span a variety of businesses:

Financial: Algorithmic Trading

Automate stock trading based on market movement. Sample query: if, within any 20 second window, StockB rises by more than 2% and StockA does not, then automatically buy StockA.

Transportation: Security and Fraud Detection

Discover fraudulent activity by detecting patterns among events. Sample query: if a single ID card is used twice in less than 5 seconds to gain access to a city’s subway system, alert security for piggybacking.

Energy and Telecommunications: Alarm Correlation

Reduce false positive alarms. Sample query: When 15 alarms are received within any 5 second window, but less than 5 similar alarms detected within 30 seconds, then do nothing.

Health Care: Patient Monitoring

Monitor the vital signs of a patient and perform some task if a particular event happens. Sample query: When a change in medication is followed by a rise in blood pressure within 20% of maximum allowable for this patient within any 10 second window, alert nearest nurse.

Summary of Oracle CEP Features

The following list summarizes the main features of Oracle CEP:

New in Version 10.3. Event Caching—Applications can optionally publish or consume events to and from a cache to increase the availability of the events and increase the performance of their applications.

New in Version 10.3. Event Record and Playback—The event repository feature of Oracle CEP allows you to record events flowing through an event processing network (EPN) and store them so you can later play back the events.

New in Version 10.3. Built-in HTTP Publish-Subscribe Adapters—The three built-in HTTP publish-subscribe adapters allow an application to easily to publish (locally and remotely) and and subscribe to an HTTP publish-subscribe server channel.

New in Version 10.3. Built-in JMS Adapters—The two JMS adapters (inbound and outbound) allow you to send and receive messages to and from a JMS queue, respectively, from your application without writing any Java code

New in Version 10.3. Visualizer Administration Console—A Web 2.0 application that consumes data from Oracle Complex Event Processing (or Oracle CEP for short), displays it in a useful and intuitive way to system administrators and operators, and, for specificied tasks, accepts data that is then passed back to Oracle CEP so as to change it configuration

New in Version 10.3. Multi-server domains (sometimes referred to as clustering)—Oracle CEP now allows multiple servers to be logically connected together for the purposes of management, and physically connected using a shared User Datagram Protocol (UDP) multicast address and port.

An application server that supports deployment of Plain Old Java applications (POJOs), or Spring applications, for handling large volumes of streaming data with low latency requirements.

Oracle CEP applications are developed and deployed as event driven applications, that is, a set of custom Spring tags is used to define the event processing network in the EPN assembly file, which extends the standard Spring context file, of your application.

The application server contains a set of real time services that include a complex event processor (CEP), adapters, and streams. The server is highly tuned for high message throughput and low latency and deterministic behavior.

The complex event processor is a high performance, continuous query engine for processing high volumes of streaming data. It has full support for filtering, correlation, and aggregation of streaming data from one or more streams.

The Event Processing Language (EPL), a SQL-like language that allows event data from streams to be declaratively filtered, correlated, aggregated, and merged, with the ability to insert results into other streams for further downstream processing. You define the EPL rules either in an XML file that configures the complex event processor or programmatically using APIs.

An Adapter SDK that provides all the tools you need to create adapters that listen to incoming data feeds.

A set of product examples that show both a simple Hello World scenario to get you started and more complex foreign exchange and algorithmic trading scenarios to showcase additional features of Oracle CEP.

A load generator utility that simulates a data feed, useful for testing your application without needing to connect to a live data feed.

A monitoring service that includes pre-built instrumentation for measuring throughput and latency at the component level.

A static and dynamic configuration framework. Static configuration is performed using XML files; dynamic configuration is performed by accessing configuration and runtime MBeans using JMX and with the command-line utility wlevs.Admin.

Oracle CEP is built on the Oracle microServices Architecture (mSA) which uses an OSGi-based framework to manage services provided by modules or feature sets. Oracle mSA provides the following services:

Supported Platforms

The following table displays the supported platforms for Oracle CEP 10gR3.

Table 2-1 Oracle CEP 10gR3 Supported Platforms

Operating System

Hardware

JVM w/ JDK 1.5.x

Release Date

Oracle Enterprise Linux 4 / OVM

x86

JRockit 32

RTM

Oracle Enterprise Linux 4 / OVM

x86-64

JRockit 32

RTM

Redhat Linux 4

x86

JRockit 32

RTM

Redhat Linux 4

x86-64

JRockit 32

RTM

Oracle Enterprise Linux 5.0 / OVM

x86

JRockit 32

RTM

Oracle Enterprise Linux 5.0 / OVM

x86-64

JRockit 32

RTM

Redhat Linux 5.1

x86

JRockit 32

RTM

Redhat Linux 5.1

x86-64

JRockit 32

RTM

SUSE Linux 9

x86

JRockit 32

RTM

SUSE Linux 9

x86-64

JRockit 32

RTM

SUSE Linux 10

x86

JRockit 32

RTM

SUSE Linux 10

x86-64

JRockit 32

RTM

Windows 2003 SP1+

x86

JRockit 32

RTM

Windows 2003 SP1+

x86-64

JRockit 32

RTM

Windows Vista (client only)

x86

JRockit 32

RTM

Windows Vista (client only)

x86-64

JRockit 32

RTM

Windows XP SP2 (client only)

x86

JRockit 32

RTM

Windows XP SP2 (client only)

x86-64

JRockit 32

RTM

Solaris 10

Sparc 64

JRockit 64

Post-RTM

Oracle CEP Development Environment for Eclipse

Oracle provides an IDE targeted specifically to programmers that want to develop Oracle CEP applications. Oracle CEP Development Environment for Eclipse is a set of plugins for the Eclipse IDE designed to help develop, deploy, and debug applications for Oracle CEP 10.3.

The key features of this IDE are as follows:

Project creation wizards and templates to quickly get started building event driven applications.

Advanced editors for source files including Java and XML files common to Oracle CEP applications.

Integrated server management to seamlessly start, stop, and deploy to Oracle CEP instances all within the IDE.

Create a new Oracle CEP application and deploy it to your new domain. See Creating Oracle CEP Applications for a description of the programming model, details about the various components that make up an application, and how they all fit together.