- This uses the python loremipsum generator. You can replace
g.generate_sentence()
with your own string or generator of choice - Make sure to replace
schema_path
in the script with your own schema path - No guarantees that this is the best way to loop over records and publish them to Kafka, just a demo. Before adapting this script, take a look at the Avro documentation...the writer might not need to be instantiated for every record, for example. I'm just not sure.
- Create a Kafka topic to test this on (default in the script is 'test')
- Replace
schema_path
with the path touser.avsc
- Open up a console Kafka consumer (see the 'quick start' section in Kafka's documentation)