Before You Begin
This 20-minute tutorial shows you how to create supporting artifacts for your Stream Analytics pipeline that monitors public transportation in the Atlanta area.
In this series, you learn how to use a Stream Analytics pipeline for real-time traffic analysis, speed violation tracking, and congestion detection. This is the first tutorial in Monitoring Public Transportation Using Stream Analytics. Read the tutorials sequentially.
- Creating Artifacts for Your Stream Analytics Pipeline
- Building a Stream Analytics Pipeline
- Creating Business Rules in Your Stream Analytics Pipeline
- Configuring Graphical Views in Your Stream Analytics Pipeline
- Defining and Configuring a Target in Your Stream Analytics Pipeline
- Publishing Your Stream Analytics Pipeline
Access to Stream Analytics
To complete the tutorials in this learning path, you must have access to an installation of Oracle Stream Analytics on-premise or in the cloud as part of Oracle Data Integration Platform Cloud (DIPC), which has Stream Analytics included in it.
Scenario
The scenario is analyzing and monitoring a public transportation system that allows you to identify bottlenecks.
Background
Stream Analytics is a graphical tool with an intuitive web-based interface that enables you to explore, analyze, and manipulate streaming data sources in real time.
This traffic management solution uses GPS fleet data. This data is low cost, accurate, and it's created in real time. Its value for government sector customers is that this fleet data reduces congestion on roadways and enhances the traveling experience. The general features represented in this solution are real-time traffic analytics, speed violation tracking, and congestion detection. These features are combined with GPS streaming sensor feeds and historical trend data using map-based visualizations. This solution uses enterprise-grade Spark Streaming, Kafka open-source messaging, a highly scalable, extensible platform built with Stream Analytics.
Some of the key benefits with this solution are low-cost rollout with zero-road, network disruption, real-time operational intelligence, which is essential for meaningful congestion reduction, and an enhanced traveler experience, with a leading streaming big data technology.
What Do You Need?
- Java Runtime Environment and Java Development Kit (8 or later)
- Access to an instance of Oracle Stream Analytics (on-premise or cloud)
resourcesfortutorials-4015265.zip
- Simulated event stream pushed to Kafka
- Important: Keep the utility running while you work on this tutorial.
Push
Simulated Events Stream to Kafka
- Extract the
resourcesfortutorials-4015265.zip
file to a folder on your machine. Notice that the extracted contents include theBusEvents.json
andOsacsEventFeeder.jar
files. - Open a command prompt.
- Go to the location where you extracted the
resourcesfortutorials-4015265.zip
file. - Push events:
java -jar OsacsEventFeeder.jar -z hostname:2181 -t tutorial -j BusEvents.json
Note: The topic name used in
this tutorial is tutorial.
The following response to the command confirms
that data is seeding the tutorial
topic. This
response is mandatory for you to proceed with the tutorial.
RESPONSE:{"offsets" : [{"partition" :0, "offset" :28,
"error_code" :null, "error" :null}], "key_schema_id" :null,
"value_schema_id" :null}
Create
a Kafka Connection
- In the navigation menu on the left, click Catalog.
- In the Create New Item menu, select Connection.
- In the Create Connection dialog box, on
the Type Properties tab, enter or select the
following values and click Next:
- Name:
Tutorial
- Tags:
tutorial, transport
(press Enter after you type each tag) - Connection Type: Kafka
Description of the illustration t0_1.png
- Name:
- On the Connection Details tab, enter the following values:
- In the Zookeepers field, enter:
- the Zookeepers URL you saved during provisioning for Oracle Data Integration Platform Cloud
- the Zookeeper hostname and port (for example: myhost:2181) for Oracle Stream Analytics on-premise
- When a message appears indicating that the connection is successful, click Save.
Create
a Stream
- On the navigation pane on the left, click Catalog.
- In the Create New Item menu, select Stream.
- In the Create Stream dialog box, on the Type Properties tab, enter or select the following values and click Next:
- Name:
Tutorial
- Tags:
tutorial
,transportation
- Stream Type: Kafka
- On the Source Details tab, select the following values and click Next:
- Connection: Tutorial
- Topic name: Tutorial
- On the Shape tab, select the following values and click Next:
- Select the default Infer Shape option
and then click Infer.
Description of the illustration t0_2.png - Shape Name:
TutorialStream
- Click Save.
Create
a Geo Fence
- In the Create New Item menu, select Geo
Fence.
- In the Create Geo Fence dialog box, enter or select the following and click Next:
- Name:
Tutorial
- Tags:
transportation
,tutorial
- Geo Fence: Manually Created Geo
Fence
Description of the illustration t0_3.png - Click Save. A page with the world map is displayed. This is where you will mark the area around Atlanta.
- On top left of the page, click the Polygon tool on the toolbar and do the following:
- Start marking the area around Atlanta on the map. When you're done, click the Polygon tool again.
- Name:
Atlanta
- Description:
Monitor public buses transport in Atlanta
- On the left side, click the Save icon to
save your changes. The Atlanta Geo Fence looks like this.
Description of the illustration t0_4.png - Click Return to Catalog.