This demo showcases the MQTT and REST protocols proxied to Kafka by Zilla. Zilla is using OpenAPI and AsyncAPI spec definitions to generate the necessary proxy config. The demo uses Open Street Maps, Open Route Service, and the MQTT Simulator to demonstrate a real-world taxi-hailing and location tracking service.
The Taxi Map UI highlights downtown San Jose, CA bars. You can hail a taxi to simulate traveling to each destination. Some shuttle buses also run routes to the bars and make permanent round trips.
- Clicking on one of the bar markers lets you hail a taxi
- The hailed taxi will "pick up" the passenger at the San Jose, CA Convention center
- The taxi will then proceed to the designated location on the map and stop sending location updates
- This demo has multiple taxi/bus IoT clients publishing location updates to Kafka using Zilla as the MQTT broker.
- The red Bar markers indicate destinations and the green Vehicle markers represent the taxi/bus IoT clients.
- Use the Taxi Map UI and click on a bar icon to "Hail a Taxi".
- The map will show the route and the hailed taxi following it. You can use the "Clear Route" button in the sidebar or click the Aklivity logo to see the full map.
- Open the Kafka UI in
live
mode to see the taxi locations updates.- Notice the MQTT topic includes the bar name in the key:
taxi/Fox_Tale_Ferm-86439137/location
. - Each message is an individual location update with a new Lat Long coord.
- Once the taxi gets to the destination, it will stop sending new updates.
- Notice the MQTT topic includes the bar name in the key:
- The demo architecture is streamlined with Zilla.
- No MQTT broker
- No Kafka Connect
- No web server
- Zilla is proxying the MQTT and REST calls to the native Kafka protocol.
- Use the OpenAPI Editor and AsyncAPI Studio to see the specs used to generate the Zilla config.
- Now you know how Zilla's Design-first, API-native approach to integration will:
- Reduce architecture and DevOps complexity
- Accelerate developer velocity
- Maximize the investment in Kafka
Demo architecture:
flowchart LR
style zilla1 stroke:#0d9b76,stroke-width:4px
tsgrpc[Dispatch Service] --> ttiot[Taxi 1] & ttiotb[Taxi 2] & ttiotc[Taxi 3]
tmuisr[\Web/] -.- |HTTP| ztos
subgraph zilla1 [Zilla Taxi Tracking]
ztos{{OpenAPI REST}} --- ztoc[consume]
ztas{{AsyncAPI MQTT}} --- ztapc[pub/sub]
end
ttiot & ttiotb & ttiotc -.-> |MQTT| ztas
subgraph cc [Confluent Cloud]
cciot[[Tracking Kafka Cluster]]
ztapc -.- cciot
ztoc -.- cciot
end
-
Start all of the services using Docker
compose
. Thestartup.sh
script willbuild
andstart
all the services. This command will alsorestart
an existing stack.- You can run this demo with Redpanda by adding the
--redpanda
flag
./startup.sh
- You can run this demo with Redpanda by adding the
-
Use the local Taxi UI for the demo.
- The Kafka topics are created during
startup
. - Browse the topics in the Kafka UI.
- The Redpanda Console is available instead if you specified the
--redpanda
flag.
- The Redpanda Console is available instead if you specified the
- You can browse the log compacted topic
taxi-locations
to see each location update from active taxis.- The
bus-locations
topic is all of the automatic updates that are routed by the zilla config - Zilla is using the other topics listed to manage the MQTT and gRPC bindings
- The
- The Taxi UI pulls the most recent location for all of the unique taxis from Kafka.
The mqtt-simulation service includes a default_routes.json
file, which starts a looping set of routes used in the demo. An additional file, default_routes_load_test.json
, is available, which leverages the simulator's ability to generate multiple topics.
-
You will see in the JSON file the config for managing the number of topics to generate by updating the
"RANGE_END"
value:"TYPE": "multiple", "RANGE_START": 1, "RANGE_END": 500,
-
The
taxi-tracking-service
in the docker-compose.yaml file mounts the default config. Update the volume mount to map the load_test file.volumes: - ./grpc/service/default_routes_load_test.json:/usr/src/app/default_routes.json
-
Ensure the
DEFAUlT_ROUTES
env var istrue
so the service will start the sim and thePRINT_SIM_LOGS
is true so the container will print the simulator output.environment: DEFAUlT_ROUTES: true PRINT_SIM_LOGS: true
-
Happy Load Testing!