I have created a kafka topic in one of my machine having IP 192.168.25.50 of topic name test-poc. Then by using kafka-console-producer i have produced message as like below
By default the broker will bind to localhost. If your machine ip is a.b.c.d
and it's a vm instance, then you need to uncomment the Line in server.properties
containing listeners=PLAINTEXT://:9092
and put listeners=PLAINTEXT://a.b.c.d:9092
If it's a docker container you can try adding the following two lines:
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://a.b.c.d:9092