

I know Heroku, Apache Mesos, Kubernetes, etc all set some PORT environment variable within the container when it starts. You can remove localhost listener since you want to connect externally. I haven't tested this)Ĭreate a Dockerfile like so and build/push to your registry ARG CONFLUENT_VERSION=7.0.1įROM confluentinc/cp-kafka:$ (Might need source /etc/confluent/docker/aci-override.


Create aci-run file with this section echo "=> Configuring for ACI networking. You could create an EventHubs cluster with Kafka support instead.īut if you want to run Kafka in Docker, the Confluent image would need extended with your own Dockerfile that would inject your own shell script between these lines which would use some shell command to fetch the external listener defined at runtime.Į.g.

KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT_INTERNAL://kafkaserver:29092,PLAINTEXT://localhost:9092 KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181' # To learn about configuring Kafka for access across networks see I want to connect to it (send messages) from outside the container (from application running on external server/local computer or another container).Īfter searching the internet, I understand that we need to provide the external IpAddress to kafka listener which would be listening from outside to connect.Įg: KAFKA_ADVERTISED_LISTENERS: PLAINTEXT_INTERNAL://kafkaserver:29092,PLAINTEXT://:9092īut since azure container instance gets ip address after it has spin up how can we connect in this case? I have a kafka instance running in Azure Container instance.
