title: how to send Json file to kafka from Python
body: <p>I have a json file like below which I want to send to kafka from python.</p>
  
  <p><strong>Json File</strong>   </p>
  
  <pre><code> filename = 'External_Risk_{}.json'.format(date.today().strftime("%Y%m%d"))
      d =df.to_json(filename, orient='records')
  </code></pre>
  
  <p><strong>Sending to Kafka</strong></p>
  
  <pre><code>from kafka import SimpleProducer, KafkaClient
  import json 
  from kafka import KafkaProducer
  producer =KafkaProducer(bootstrap_servers='xxx.xxx.xxx.xxx')
  jd = json.dumps(d)
  producer.send_messages(b'message1',jd)
  </code></pre>
  
  <p>But it not working . What is correct way of sending a json file to Kafka.</p>