To demonstrate Waterstream capabilities, we’ve built a live demo simulating 15,000 trucks driving around Italy and integrating it with Kafka and ksqlDB. Starting from the current position, each vehicle follows a route computed with OpenStreeMap towards a random destination. Upon reaching the destination, the truck stops for a random time interval before starting for a new random destination, thus simulating driver rest and new load preparation. While they move, vehicles send position, next waypoint and speed. The overall effect is pretty realistic with a smooth, fluctuating flow of messages presented in the embedded Grafana dashboard through Prometheus.
Data is ingested with Waterstream with MQTT and stored into the vehicles Kafka topic. With ksqlDB, a very simple aggregation is computed and written into the statistics topic. Waterstream reads both topics and use them to update the user interface of the demo leveraging its WebSockets capabilities. Thus, user can follow a subset of vehicles on the map as they move and see the aggregation presented with a pie chart.