This post demos how to make a distance calculator on Streaming Data Platform
Calculate the average value of each fixed time window (3s)
Normal: <=1m A little Far: > 1m && <= 3m Far: > 3m
cd sdp-starter-kit/distance-calculator/charts/
kubectl get runtimeimages -A
Update flinkImage variable in calculator/values.yaml with the runtime image name available for the flink version 1.15.2.
kubectl get projectfeature pravegamqttbroker --output="jsonpath={.spec.templates.pravegaMQTTBroker}"
Update chartVersion variable in features/values.yaml with spec.values.image.tag.
./deploy.sh <name_of_the_application>
ex:- ./deploy.sh distance-calculator
Wait for few minutes until flink application starts
Below view can be observed
Note:- In case if you don’t see any graph or button to Zoom to Data, Apply the time range of 10:37:00 to 11:00:00 for the current date
cd distance-calculator
mvn clean package
Click on pravega-mqtt-broker in the “Secrets” section to get MQTT_USERNAME and MQTT_PASSWORD
set MQTT_BROKER_URL=tls://<MQTT_BROKER_URL>:8883
set MQTT_ALLOW_INSECURE=true
set MQTT_DATA_FILE=C:\\<Project_Path>\\mqtt-writer\\Distance.csv
set MQTT_USE_AUTH=true
set MQTT_USERNAME=<MQTT_USERNAME>
set MQTT_PASSWORD=<MQTT_PASSWORD>
export MQTT_BROKER_URL=tls://<MQTT_BROKER_URL>:8883
export MQTT_ALLOW_INSECURE=true
export MQTT_DATA_FILE=/<Project_Path>/mqtt-writer/Distance.csv
export MQTT_USE_AUTH=true
export MQTT_USERNAME=<MQTT_USERNAME>
export MQTT_PASSWORD=<MQTT_PASSWORD>
java -jar mqtt-writer\target\mqtt-writer-1.0.0.jar
https://github.com/vangork/sdp-starter-kit/tree/master/distance-calculator