We will use this JCDecaux API https://developer.jcdecaux.com to observe rentals at each bike station in real time...
To start, you will need to retrieve an API key by creating an account at https://developer.jcdecaux.com/#/signup. Once you have created your account, you will have an API key displayed in your user account. If your API key is "XXX", you can verify that it is working correctly by retrieving the list of all stations using the following command: $ curl https://api.jcdecaux.com/vls/v1/stations?apiKey=XXX
In spring configuration file application.properties of module producer-station project, put your apiKey
jcdecaux.api.key= your apiKey
Download https://kafka.apache.org the latest Kafka release and extract it:
$ tar -xzf kafka_2.13-3.2.0.tgz
$ cd kafka_2.13-3.2.0
NOTE: Your local environment must have Java 8+ installed.
Run the following commands in order to start all services in the correct order:
- Start the ZooKeeper service
-Note: Soon, ZooKeeper will no longer be required by Apache Kafka.
$ bin/zookeeper-server-start.sh config/zookeeper.properties
or window
$ .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
Open another terminal session and run:
-
Start the Kafka broker service
$ bin/kafka-server-start.sh config/server.properties
or window
$ .\bin\windows\kafka-server-start.bat .\config\server.properties
Once all services have successfully launched, you will have a basic Kafka environment running and ready to use.
$ mvn clean install
To built .jar file into your local Maven repository
- Producer Station JCDecaux
$ cd producer-station
$ mvn spring-boot:run
- Consumer Station JCDecaux
$ cd consurmer-station
$ mvn spring-boot:run
Websocket Dashboard JCDecaux Producer