Make Zookeeper usage optional for KafkaContainer
See original GitHub issueHi
Starting since Kafka 2.8 Zookeeper is now an optional component because Kafka node can act as an active controller (new “process.roles” property). However I see from the code (configure method in the KafkaContainer class), that zookeeper.connect property is always added via environment variables:
if (externalZookeeperConnect != null) {
withEnv("KAFKA_ZOOKEEPER_CONNECT", externalZookeeperConnect);
} else {
addExposedPort(ZOOKEEPER_PORT);
withEnv("KAFKA_ZOOKEEPER_CONNECT", "localhost:" + ZOOKEEPER_PORT);
command += "echo 'clientPort=" + ZOOKEEPER_PORT + "' > zookeeper.properties\n";
command += "echo 'dataDir=/var/lib/zookeeper/data' >> zookeeper.properties\n";
command += "echo 'dataLogDir=/var/lib/zookeeper/log' >> zookeeper.properties\n";
command += "zookeeper-server-start zookeeper.properties &\n";
}
And by default Zookeeper is always started (externalZookeeperConnect is not initialized). Also there’s no API to distinguish between two modes (with and without Zookeeper) which I guess will be useful for the developers.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
My kafka docker container cannot connect to my zookeeper ...
Solving the startup race issue ... Another option is to use --restart=on-failure flag with docker run. This will make sure the container is ......
Read more >Exploring ZooKeeper-less Kafka - Gunnar Morling
A value can be obtained using the new bin/kafka-storage.sh script; going forward, we'll likely add an option to the Debezium Kafka container ......
Read more >Running Apache Kafka on Containers - DEV Community
To get started with Kafka on Docker, we are going to use ... Create a docker-compose.yaml file with one zookeeper and one Kafka...
Read more >Configuring Strimzi
Optional configuration for Cruise Control, which is used to rebalance the Kafka cluster. Create or update the resource: kubectl apply -f < ...
Read more >Apache Kafka Reference Guide - Quarkus
In this case the producer will use this method as generator to create an ... final KafkaContainer kafka = new KafkaContainer(); @Override public...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi,
A made a Kraft POC. https://github.com/testcontainers/testcontainers-java/pull/6129
Feedbacks are welcome!
thanks for the update @kiview, @ecsimsw and I read the comments as well. We’ll focus on this issue from now on.