Interface KafkaContainer

All Superinterfaces:
AutoCloseable, org.testcontainers.lifecycle.Startable
All Known Implementing Classes:
StrimziKafkaCluster, StrimziKafkaContainer

public interface KafkaContainer extends org.testcontainers.lifecycle.Startable
KafkaContainer is an interface that represents a Kafka container. It extends the Startable interface, allowing Kafka nodes to be started and stopped.

Implementations of this interface should provide mechanisms to manage Kafka node instances, including configuration and connection details necessary for integration and system testing. Kafka nodes can act as brokers, controllers, or combined-role nodes depending on their configuration.

  • Method Summary

    Modifier and Type
    Method
    Description
    Get the Kafka controller bootstrap servers for admin operations that require controller access.
    Get the Kafka cluster bootstrap servers.

    Methods inherited from interface org.testcontainers.lifecycle.Startable

    close, getDependencies, start, stop
  • Method Details

    • getBootstrapServers

      String getBootstrapServers()
      Get the Kafka cluster bootstrap servers.
      Returns:
      bootstrap servers
    • getBootstrapControllers

      String getBootstrapControllers()
      Get the Kafka controller bootstrap servers for admin operations that require controller access. This is particularly useful in KRaft mode for operations like cluster metadata queries.
      Returns:
      controller bootstrap servers