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.
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
Add an Adapter on the EPN diagram and set its properties.
Add a Channel on the EPN diagram.
Connect the BusMonitorAdapter to the BusMonitorChannel.
Add an Oracle CQL processor to filter events based on certain criteria.
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>
Add other Channel on the EPN diagram.
Add other Adapter on the EPN diagram and set its properties.
Start the Oracle Stream Explorer Server and deploy the application.
Run the load generator with the BusData.prop properties file to load test data.
When you open the BusInfractionData.csv file created, you will see only the events that have the value of speed property higher than 50.