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 Portsoutput:confluent local kafka start - Add the port from the previous step to
properties.inifile - 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 cmakegit clone https://github.com/google/flatbuffers.gitcd flatbufferscmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Releasemake- The
./flatcbinary can be used to compile
To compile the sample schema in this repo for Python:
rm -rf devx
/path/to/flatc --python vehicle.fbs