This is the issue I am facing. I am running kafka producer code in my wsl environment in my machine.Kafka broker and and Kafka consumer is running in an Ubuntu VM in the same machine to which I ssh’d into using moaxterm. When I run the kafka producer code , its unable to find the broker which is running in the ubuntu VM. Both wsl and ubuntu VM are in the same machine and using the same network. Also ping <VM-IP> from wsl works but telnet <VM-IP> 9092 does not. I have added the VM-IP:9092 in the Kafka-producer under bootstart_servers. Also updated the server.properties file and changed the listners to 0.0.0.0:9092 and advertised listeners to <VM-IP>:9092. I dont understand what else to do.
Firewall is inactive too.I want the producer to find this broker running in the ubuntu VM and send data to the consumer. i am using confluent.
This my kafka producer code in wsl.
self.producer = KafkaProducer( bootstrap_servers='<VM-IP>:9092', value_serializer=lambda m: json.dumps(m).encode('utf-8'), security_protocol="PLAINTEXT"
haritha tilak is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1