How to successfully connect my own Producer to Lenses 6 Community edition embedded Kafka?

The Lenses Community edition 6 preview is out.

It includes Lenses 6 as well as a self-contained Kafka broker, Schema Registry and Kafka Connect cluster. But it also allows you to connect Lenses to your own Kafka cluster.

https://lenses.io/apache-kafka-docker/ and docs: Quick Start | Lenses Docs

When running on a localhost and deployed via docker-compose : How to produce messages to the local Kafka broker that’s contained in the docker-compose?

1 Like

By default, in the docker-compose file for the free Lenses Community, the ADV_HOST is set to kafka-demo which also represents the Docker network.

Therefore, to successfully connect your own Producer and send messages to the local/embedded Kafka broker, you would need to follow 2 steps :

1: Add line 89 of docker compose , to expose kafka port 9092 :

ports:
- 9092:9092

2 : add

127.0.0.1 kafka-demo

…to your etc/hosts file to resolve kafka-demo .
(on windows, the host file is at c:\windows\system32\drivers\etc\hosts.file )

then you can have your code produce messages to localhost:9092