GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - doit01/spring-flights: Demo application showcasing RSocket support in Spring

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
flight-client
flight-client
 
 
flight-tracker
flight-tracker
 
 
gradle/wrapper
gradle/wrapper
 
 
radar-collector
radar-collector
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Spring Flights Application

This is a demo application showcasing RSocket support in Spring.

This application is made of 3 modules:

  • radar-collector, an app that provides information about radars and the aircraft signals they collect.
  • flight-tracker and flight-client, an app that displays an interactive map with radars and aircrafts.

Running the applications

First, run the collector application:

$ ./gradlew :radar-collector:build
$ java -jar radar-collector/build/libs/radar-collector-0.0.1-SNAPSHOT.jar

Then, run the tracker web application:

$ ./gradlew :flight-tracker:build
$ java -jar flight-tracker/build/libs/flight-tracker-0.0.1-SNAPSHOT.jar

The tracker application is available at http://localhost:8080/index.html

Radar Collector

This application is providing information about radars (here, airports): their IATA code, location and aircraft signals recorded. The aircraft signals are randomly generated and the actual list of radars is actually created from a list of airports, inserted in a MongoDB database.

The application starts an RSocket server with TCP transport, at localhost:9898.

You can get a list of airports located inside specific coordinates, using the rsocket-cli:

rsocket-cli --stream --metadataFormat=message/x.rsocket.routing.v0 -m=locate.radars.within --dataFormat=json \
-i='{"first":{"lng": 3.878915, "lat": 46.409025}, "second": {"lng": 6.714843, "lat": 44.365644}}' tcp://localhost:9898/

You can also get a stream of aircraft locations for a given radar, with:

rsocket-cli --stream --metadataFormat=message/x.rsocket.routing.v0 -m=listen.radar.LYS --dataFormat=json -i "" tcp://localhost:9898/

Flight Tracker

This application displays an interactive map showing radars - it is also concatenating the streams of aircraft signals for the radars displayed on screen.

The application starts a WebFlux server at localhost:8080, with an RSocket over websocket endpoint on /rsocket. The flight-client module builds the JavaScript client using Leaflet and the the websocket client from rsocket-js.

The browser will first locate all radars in the current view box; you can do the same on the CLI with:

rsocket-cli --stream --metadataFormat=message/x.rsocket.routing.v0 -m=locate.radars.within --dataFormat=json \
-i='{"viewBox": {"first":{"lng": 3.878915, "lat": 46.409025}, "second": {"lng": 6.714843, "lat": 44.365644}}, "maxRadars": 10}' ws://localhost:8080/rsocket

Once all the radars are retrieved, we can ask a merged stream of all aircrafts for those radars to the server.

rsocket-cli --stream --metadataFormat=message/x.rsocket.routing.v0 -m=locate.aircrafts.for --dataFormat=json \
-i='[{"iata":"LYS"}, {"iata":"CVF"}, {"iata":"NCY"}]' ws://localhost:8080/rsocket

The browser will perform such a request and update the aircrafts positions live.

The Leaflet map has a small number input (bottom left) which controls the reactive streams demand from the client. Decreasing it significantly should make the server send less updates to the map. Increasing it back should catch up with the updates.

Also, once the RSocket client is connected to the server, a bi-directionnal connection is established: they're now both able to send requests (being a requester) and respond to those (being a responder). Here, this demo shows how the JavaScript client can respond to requests sent by the server.

Sending the following request to the web server will make it send requests to all connected clients to let them know that they should change their location to the selected radar:

curl -X POST localhost:8080/location/CDG

About

Demo application showcasing RSocket support in Spring

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.