Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Enhancement]: Creating Kafka Cluster #9873

@RuslanHryn

Description

@RuslanHryn

Module

Kafka

Proposal

org.testcontainers.kafka.ConfluentKafkaContainer and org.testcontainers.kafka.KafkaContainer don't support creating a Kafka cluster with multiple brokers using KRaft. However, deprecated org.testcontainers.containers.KafkaContainer supports creating the Kafka cluster.
You have tests for the creation of the cluster using deprecated KafkaContainer here https://github.com/testcontainers/testcontainers-java/blob/main/examples/kafka-cluster/src/test/java/com/example/kafkacluster/KafkaContainerClusterTest.java

The problem is that method protected void configure() sets only one broker into KAFKA_CONTROLLER_QUORUM_VOTERS during the start of the container and it is not possible to override this env var with multiple brokers as it was possible in deprecated KafkaContainer.

Please add support of the KRaft cluster to org.testcontainers.kafka.ConfluentKafkaContainer and org.testcontainers.kafka.KafkaContainer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions