View Source Testcontainers.KafkaContainer (testcontainers v1.12.0)

Provides functionality for creating and managing Kafka container configurations.

Summary

Functions

Creates a new KafkaContainer struct with default configurations.

Overrides the default broker id used for the Kafka container.

Overrides the default kafka port used for the Kafka container.

Overrides the default zookeeper host used for the Kafka container. Available only when consensus_strategy is kraft

Overrides the default consensus strategy used for the Kafka container.

Overrides the default image used for the Kafka container. Right now we support only confluentinc images.

Overrides the default kafka port used for the Kafka container.

Set the reuse flag to reuse the container if it is already running.

Overrides the default wait timeout used for the Kafka container.

Overrides the default zookeeper host used for the Kafka container. Available only when consensus_strategy is external

Overrides the default zookeeper port used for the Kafka container.

Functions

new()

Creates a new KafkaContainer struct with default configurations.

with_broker_id(config, broker_id)

Overrides the default broker id used for the Kafka container.

with_broker_port(config, broker_port)

Overrides the default kafka port used for the Kafka container.

with_cluster_id(config, cluster_id)

Overrides the default zookeeper host used for the Kafka container. Available only when consensus_strategy is kraft

with_consensus_strategy(config, consensus_strategy)

Overrides the default consensus strategy used for the Kafka container.

with_image(config, image)

Overrides the default image used for the Kafka container. Right now we support only confluentinc images.

with_kafka_port(config, kafka_port)

Overrides the default kafka port used for the Kafka container.

with_reuse(config, reuse)

Set the reuse flag to reuse the container if it is already running.

with_topic_partitions(config, topic_partitions)

Overrides the default topic

with_wait_timeout(config, wait_timeout)

Overrides the default wait timeout used for the Kafka container.

with_zookeeper_host(config, zookeeper_host)

Overrides the default zookeeper host used for the Kafka container. Available only when consensus_strategy is external

with_zookeeper_port(config, zookeeper_port)

Overrides the default zookeeper port used for the Kafka container.