Skip to content

Weather Services

Darshan Shinde edited this page Feb 14, 2020 · 1 revision

Description:

We have implemented three micro-services,
1. Data retrieval: This micro-service is used to fetch weather API links from National Weather Service (www.weather.gov).
2. Data post-processing: This microservice is used to post-process data. The post-process results are dumped into the Kafka topic.
3. Model executor: We are executing the model and sends the result to data post-process micro-service.

Micro-service folder:

1. Data retrieval: weather_service/data_retrieval/
2. Data post-processing: weather_service/data_postprocess/
3. Model executor: weather_service/model_executor/

Pre-requisites:

  1. python3 or higher
  2. pip3 or higher

Install required libraries:

pip3 install -r requirement.txt

Other dependencies:

Zookeeper and Kafka should be running before starting the API Gateway micro-service.
To install and configure Zookeeper and Kafka refer: https://www.c-sharpcorner.com/article/step-by-step-installation-and-configuration-guide-of-apache-kafka-on-windows-ope/

Run the code:

Go to appropriate folders and run the below commands.

1. Data retrieval: python3 data_retrieval.py
2. Data post-processing: python3 data_postprocess.py
3. Model executor: python3 model_executor.py

Note:

  1. Data retrieval and Data post-processing microservices must be running before running Model executor micro-service.
  2. Make sure the Model executor is registered with Zookeeper with the name WeatherData (Message will be displayed on python console).