This is a simple example showing how to produce and consume FlatBuffers-formatted data in Kafka using Python.
- Docker should be installed and running
- Install the Confluent CLI
- Start Kafka in Docker and note the
Plaintext Ports
output:confluent local kafka start
- Add the port from the previous step to
properties.ini
file - Produce:
./producer.py properties.ini
- Consume:
./consumer.py properties.ini
If you change the schema in vehicle.fbs
, you'll first need the flatc
compiler. On Mac:
brew install cmake
git clone https://github.com/google/flatbuffers.git
cd flatbuffers
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make
- The
./flatc
binary can be used to compile
To compile the sample schema in this repo for Python:
rm -rf devx
/path/to/flatc --python vehicle.fbs