Creating a Stream Explorer Project

According to the Oracle Stream Explorer 12c documentation, it is a high throughput and low latency platform for developing, administering, and managing applications that monitor real-time streaming events.

In this post we will create a basic Oracle Stream Explorer application that models a simple speed limit alert system. The application receives example data about speed of buses, monitors the data for certain characteristics, and based on the results, prints some of the data to the console.

Download the sample application: SXBusMonitorApp.zip.

In the JDeveloper, create a new OEP Application.

creating-a-stream-explorer-project1

Below the EPN diagram, select the Event Types tab.
In the Event Type Definitions window, select the BusMonitor.context.xml folder and click Add.
In the Type Name field enter BusEvent, and add the following properties:

  • busId: int
  • speed: int
  • _timestamp: java.lang.String

creating-a-stream-explorer-project2

Add an Adapter on the EPN diagram and set its properties.

creating-a-stream-explorer-project3

creating-a-stream-explorer-project4

Add a Channel on the EPN diagram.

creating-a-stream-explorer-project5

Connect the BusMonitorAdapter to the BusMonitorChannel.

creating-a-stream-explorer-project6

Add an Oracle CQL processor to filter events based on certain criteria.

creating-a-stream-explorer-project7

Right-click the GetSpeedInfractionProcessor stage and select Go To Configuration Source.
The CQL query selects the busId, speed and _timestamp properties from each incoming bus event, tests the speed property for a value higher than 50, and outputs a set of 1 qualifying event at a time. The NOW operator creates a window of time that contains the event that happened at the last tick of the system.
Replace the sample Oracle CQL code with the Oracle CQL code provided here:

<query id="GetSpeedInfraction"><![CDATA[
   select bus.busId, bus.speed, bus._timestamp 
   from BusMonitorChannel[now] as bus 
   where bus.speed > 50 
]]></query>

creating-a-stream-explorer-project8

Add other Channel on the EPN diagram.

creating-a-stream-explorer-project9

Add other Adapter on the EPN diagram and set its properties.

creating-a-stream-explorer-project10

Done!
Start the Oracle Stream Explorer Server and deploy the application.
Run the load generator with the BusData.prop properties file to load test data.

creating-a-stream-explorer-project11

When you open the BusInfractionData.csv file created, you will see only the events that have the value of speed property higher than 50.

creating-a-stream-explorer-project12

Waslley Souza

Autor: Waslley Souza

Consultor Oracle com foco em tecnologias Oracle Fusion Middleware e SOA. Certificado Oracle WebCenter Portal, Oracle ADF e Java.

Deixe uma resposta

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *