This is a demo on how to stream real-time data from Apache Kafka to Apache Pinot on your local machine using Docker.
The following docker-compose.yml file creates containers for Apache Pinot, Apache Kafka, and a message producer using a local image.
Additionally, two Kafka listeners (INTERNAL and EXTERNAL) will be configured.
Apache Pinot will ingest real-time data from Apache Kafka on the INTERNAL address "kafka:9092".
The host will be able to produce and consume Apache Kafka messages on the EXTERNAL address "localhost:9093".
All communication is done over non-secure HTTP PLAINTEXT.
Quickstart (Docker required)
$ git clone https://github.com/thread53/kafka-demo.git$ cd kafka-demo$ docker compose build --no-cache && docker compose up -d- Wait a bit for the Apache Pinot container to finish initializing, then create the schema and table:
$ curl -i -X POST -H 'Content-Type: application/json' -d @pinot/schema.json localhost:9000/schemas
$ curl -i -X POST -H 'Content-Type: application/json' -d @pinot/table.json localhost:9000/tables - Point your browser to http://localhost:9000/#/query and query
demotopictable
$ git clone https://github.com/thread53/kafka-demo.git$ cd kafka-demo$ python -m venv .venv$ source .venv/bin/activate$ pip install -r requirements.txt$ python src/producer.py(ensure to setbootstrap_serversto'localhost:9093')- In another terminal run
$ python src/consumer.pyto start consuming the messages.
