Generate the API docs
./mvnw package
Spin up the API
./mvnw spring-boot:run -Dspring-boot.run.arguments="--spring.profiles.active=api --spring.devtools.restart.enabled=false"
Create an instance of kafka. You can follow the Quickstart guide. Kafka Quickstart
Using a separate termial, create the kafka topics to be used by the microservice. Refer to the quickstart quide on how to create topics. https://kafka.apache.org/quickstart#quickstart_createtopic
bin/kafka-topics.sh --create --topic app-insights-measurements-topic --partitions 1 --replication-factor 1 --bootstrap-server view-message-broker:9092
./mvnw spring-boot:run -Dspring.profiles.active=messageBroker
Using a separate termials, run kafka producers for sites, devices, measurements and insights.
bin/kafka-console-producer.sh --topic sites-topic --bootstrap-server localhost:9092
Create dummy insights data
[
{
"time": "2022-02-21T02:00:00Z",
"pm2_5": 72,
"pm10": 85,
"empty": true,
"forecast": true,
"frequency": "HOURLY",
"siteId": "site-01"
},
{
"time": "2022-02-20T23:00:00Z",
"pm2_5": 8,
"pm10": 5,
"empty": false,
"forecast": false,
"frequency": "HOURLY",
"siteId": "site-02"
},
{
"time": "2022-02-20T00:00:00Z",
"pm2_5": 11,
"pm10": 10,
"empty": false,
"forecast": false,
"frequency": "DAILY",
"siteId": "site-01"
},
{
"time": "2022-02-20T00:00:00Z",
"pm2_5": 21,
"pm10": 29,
"empty": false,
"forecast": true,
"frequency": "DAILY",
"siteId": "site-02"
}
]
sh setup/run.sh
Ctrl + c
sh clean.sh
./mvnw compile