jmarin / flighttracker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vert.x Example Maven Project which has Java, Python, and a spatial feed.

Prequisites:

  1. You need an OpenShift account
  2. You need a [https://developer.flightstats.com/](FlightStats account)
  3. You need Maven installed on your local machine

Create a new OpenShift application with a vert.x cartridge

rhc app create flighttracker jboss-vertx-2.1 -g medium -s

For best performance and flexibility I used a medium gear and I made it scalable.

You will need to add your FlightStats environment variables to the application after creation

rhc set-env set OPENSHIFT_FLIGHTSTATS_ID=<app id>
rhc set-env set OPENSHIFT_FLIGHTSTATS_KEY=<key>

Then clone this repo locally.

You need to have Maven installed to build this project.

Then inside the root of the repository do:

mvn package

This will package up the project into a module. We used a module because there are three different languages used in the application, JavaScript, Java, and Python. This wasn't required to make the project but it was more to demonstrate the polyglot nature of vert.x

To deploy the application go into the new directory called target. Take the directory titled "com.openshiftvertx-tracking0.1" and copy it into the mod directory inside the git repository flighttracker. Then inside the git repository go into the configuration directory and edit vertx.env file.

Uncomment export vertx_module and make it like this:

export vertx_module=com.openshiftvertx-tracking0.1

and comment out the rest of the export lines.

Remove server.js from the git repository.

Now you can do

git add --all .
git commit -am "your message"
git push

When this is finished you should be able to go to

flighttracker-.rhcloud.com

Remember you may have to wait a few seconds for the first pins to show up because pins aren't drawn until a set of flights is pushed from the EventBus to index.html

About