Skip to content

Kafka, PostgreSQL, Kafka Connect, Kafka Stream in Java, Google Map in React

Notifications You must be signed in to change notification settings

sijoonlee/kingston-bus-positions-using-kafka-and-websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

busdemo
This is to show Kingston Transit Buses' position on Google map in real-time

Data flow

img

Running Backend

  1. Go To Directory 'backend'

  2. Run Kafka, PostgresSQL Docker image

    docker-compose up -d
    
  3. Run Java applications

    • Setup Kafka Connect : Run main method in ConnectAPI.java
      • Need few minutes before running since docker containers need time to boot up. You should be able to see messages like below if successful. If not, try to run again few minutes later
          [main] INFO com.github.sijoonlee.connector.ConnectAPI - Using GET
          [main] INFO com.github.sijoonlee.connector.ConnectAPI - RESP STATUS CODE: 200
          [main] INFO com.github.sijoonlee.connector.ConnectAPI - RESP STATUS BODY: ["vehicles"]
      
    • Get GTFS real time data: Run main method in GtfsRealtimeKingston.java
    • Setup Kafka Stream : Run main method in VehicleStream.java
    • Server up Websocket : Run main method in WSServer.java

Running Frontend

  1. Run React Server
npm run start
  • Bus icons will be shown up on the map after few seconds

Clean up

  1. Shutdown docker containers
docker-compose down --volumes

About

Kafka, PostgreSQL, Kafka Connect, Kafka Stream in Java, Google Map in React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published