Help a newbie out with sending info to Kafka from Python

I’m venturing out into a whole new area. The world of Kafka. We are using Python and the confluent library to send messages. We wrote what I thought was the correct code, but alas. NO. :frowning_face:

Getting an error on the produce call.

Here’s a little code segment. Any offers of help would be accepted readily.

json_file_path = ‘test.json’
with open(json_file_path, ‘r’) as file:
data = json.load(file)

Produce each record to Kafka

for record in data[‘result’]:
producer.produce(topic, value=record)
producer.flush()