I\'m trying to start a kafka service using docker-compose, and it should be able to be accessed inside and outside docker. So, it should be matter of setting the right adver
Your config of the listeners looks correct, the problem is with your Docker Compose:
ports:
- "9094:9092"
You’re mapping 9094
(‘Outside’) back to 9092
(‘Inside’) and thus when you connect you’re connecting to the ‘Inside’ listener. If you remove this line of config then your listener set up should work as intended.
For more info, see http://rmoff.net/2018/08/02/kafka-listeners-explained/