I expose the port 9092 then i run the kafka broker inside docker. But When I run the python script i get the errors
ERROR:kafka.conn:DNS lookup failed for b5c5b06f6761:9092 (AddressFamily.AF_UNSPEC)
I tried docker ip and machine ip instead of localhost but gives same error.
Here is my code.
producer = KafkaProducer(bootstrap_servers=['localhost:9092'],
value_serializer=lambda x:
dumps(x).encode('utf-8'))
producer.send('vtintel', value={'id':123})