No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Introduction

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.

Pre-requisites

The necessary tooling varies depending on your target environment.

Local pre-requisites

  • 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.

Paths and URLs

Local paths and URLs

When running in a local environment, use these paths or URLS for accessing components:

Running Demo

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: datagrid
  • MANAGEMENT_PASSWORD: developer
  • MANAGEMENT_USER: developer
  • NUMBER_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.

Live Events

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: