This project is developed using python 3.8.2. in a Window system using Oracle Virtual Machine.
This is improved version of the
It calculates
a. the average temperature for each city
b. the top three most common "weather text" for each city
This project contains two aparts: producer and consumer.
- Producer will produce a unbounded data stream to mimic the real life situation.
- To do so, 0.json will be loop through infinitely as an example.
- It will publish a meesage in a fixed time interval.
Consumer will consumer the unbounded data stream into two forms.
-
The consumer_graph will consume the messages and output two graphs as below.
-
The consumer_analysis will consume the messages and output two csvs accordingly.
- Java 7 or greater is required in your machine in order to set up Kafka.
- Install Kafka by downloading binaries.
- Learn more here.
-
Open a new terminal
-
To start Kafka, run the command in the terminal
sudo systemctl start kafka.service
-
To check the status of kafka-service, run the command in the terminal
sudo systemctl status kafka.service
-
Install Dependencies
pip install -r requirements.txt
-
To run the producer, run the following command in the terminal
python producer.py
-
To run the consumer, open another terminal and run the following command
python consumer_analysis.py