nsakenov / kafka_speed_check

This is the supporting repository for a project: Tesla speed check with Kafka and Flutter Web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kafka Speed Check

Kafka Docker Images Python

This is the supporting repository for a project: Tesla speed check with Kafka and Flutter Web.

Design

Install

The backend part of the project is fully containerised. You will need Docker and Docker Compose to run it.

Quickstart

  • In the project directory (where the docker-compose.yml located), spin up the local single-node Kafka cluster:
$ docker compose up
  • Check the cluster is up and running (wait for "started" to show up):
$ docker-compose logs -f broker | grep "started"

Usage

Show a stream of transactions in the speed.check topic (optionally add --from-beginning):

$ docker-compose exec broker kafka-console-consumer --bootstrap-server localhost:9092 --topic speed.check

Topics:

  • current.speed: current speed provided by the user of Flutter Web application
  • speed.check: processed speed from the upstream consumer

Example current.speed:

111

Example speed.check result:

{'speed': 111, 'exceeds': True}

Teardown

To stop the transaction generator and fraud detector:

$ docker compose down

To stop the Kafka cluster (use down instead to also remove contents of the topics):

$ docker compose stop

To remove the Docker containers:

$ docker compose rm

About

This is the supporting repository for a project: Tesla speed check with Kafka and Flutter Web

License:MIT License


Languages

Language:Shell 82.0%Language:Python 15.7%Language:Dockerfile 2.3%