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

**URL:** <https://ask.lenses.io/t/how-to-successfully-connect-my-own-producer-to-lenses-6-community-edition-embedded-kafka/308>\
**Category:** Lenses Community Edition\
**Created:** [November 22, 2024, 6:46pm UTC](https://ask.lenses.io/t/how-to-successfully-connect-my-own-producer-to-lenses-6-community-edition-embedded-kafka/308 "2024-11-22T18:46:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Duchene\_lenses](https://dub1.discourse-cdn.com/flex017/user_avatar/ask.lenses.io/simon_duchene_lenses/32/104_2.png) [@Simon\_Duchene\_lenses](https://ask.lenses.io/u/Simon_Duchene_lenses)\
**Post date:** [November 22, 2024, 6:46pm UTC](https://ask.lenses.io/t/how-to-successfully-connect-my-own-producer-to-lenses-6-community-edition-embedded-kafka/308/1 "2024-11-22T18:46:49Z")

</div>

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/](https://lenses.io/apache-kafka-docker/) and docs: [Quick Start | Lenses Docs](https://docs.lenses.io/latest/getting-started/quickstart)

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?

---

<div class="post-metadata">

**Author:** ![Simon\_Duchene\_lenses](https://dub1.discourse-cdn.com/flex017/user_avatar/ask.lenses.io/simon_duchene_lenses/32/104_2.png) [@Simon\_Duchene\_lenses](https://ask.lenses.io/u/Simon_Duchene_lenses)\
**Post date:** [November 22, 2024, 6:49pm UTC](https://ask.lenses.io/t/how-to-successfully-connect-my-own-producer-to-lenses-6-community-edition-embedded-kafka/308/2 "2024-11-22T18:49:30Z")

</div>

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`
