This is a repository containing a demo based on transport.opendata.ch and sbb.ch data to show how to work with streaming data. The aim of the demo is to show how to use OpenShift, together with Vert.x and Infinispan to analyse such streaming data. It uses RxJava2 APIs for transforming data and coordinate the actions.
The necessary tooling varies depending on your target environment.
- OpenShift Origin 3.7.2
- Docker 1.13.1 (recommended, but should work with higher versions too). This demo has been tested with Docker 17.09 too.
- Maven 3
- Node.js 4.2 or higher. If not already using Node.js, you can install Node Version Manager to easily switch between different versions.
This demo could be run alternatively using Minishift.
When running in a local environment, use these paths or URLS for accessing components:
-
OpenShift Console:
https://127.0.0.1:8443/console
- It is recommended that you use Google Chrome or Firefox for accessing it.
-
Infinispan visualizer:
-
Application URL:
-
Dashboard HTTP host path:
-Dhttp.host=app-myproject.127.0.0.1.nip.io
Start OpenShift by calling:
./setup-local-openshift.sh
Head to OpenShift Console, click on Select from Project
and select My Project
.
Select Infinispan ephemeral template and give it these parameters, leaving the rest of parameters as they are:
APPLICATION_NAME
: datagridMANAGEMENT_PASSWORD
: developerMANAGEMENT_USER
: developerNUMBER_OF_INSTANCES
: 3
Click Next
, then click Close
.
While the data grid loads, start the graphical Infinispan visualizer:
cd visual
./deploy.sh
Verify the visualizer shows 3 nodes via Infinispan visualizer URL.
Next, build and deploy the main application:
cd app
./first-deploy.sh
Go to the visualizer and switch to repl
cache.
Then, switch to terminal and execute:
curl <app-url>/test
It should return something similar to this:
Value was: world
You should also see one dot appearing in each of the nodes in the visualizer for cache repl
.
This represents that each node has an entry, which is what the test endpoint does.
Next, switch the visualizer to the station-boards
cache.
Call up the injector so that data is injected:
curl <app-url>/inject
Once the injector started, check the visualizer and see how each node has more and more dots around it.
Next, execute dashboard.Dashboard
from the IDE passing in the correct -Dhttp.host
value.
You should see a dashboard appearing with delayed trains.
For the final visualization, there's a Google Maps based web application that tracks positions of delayed trains. First, start the web application by calling:
cd web-viewer
npm install
npm start
Alternatively, if using Node Version Manager you can simply call start.sh
script.
Then, open a browser to address
http://localhost:3000
.
It should show an empty Google Maps.
Next, restart the dashboard and you should start seeing blue dots representing positions of delayed trains.
Here's a list of conferences and user groups where this demo has been presented.
The live-coding
folder contains step-by-step live coding instructions of the demos, as presented in these live events:
- 19th October 2017 - Basel One ( slides | video NA | live demo steps )
- 24th November 2017 - Codemotion Madrid ( slides | video | live demo steps )
- 6th February 2018 - JFokus 2018 ( slides | video NA | live demo steps )
- 26th April 2018 - Great Indian Developer Summit 2018 ( slides | screencast | live demo steps )
- 20th October 2018 - Voxxed Days Ticino 2018 ( slides | video NA | live demo steps )