Class MskConfig


public class MskConfig extends AbstractServiceConfig<MskConfig.Builder>
Configuration for MSK (Managed Streaming for Apache Kafka)-specific container settings.

Instances are created via MskConfig.Builder:


 MskConfig config = MskConfig.builder()
     .enabled(true)
     .mock(false)
     .defaultImage("redpandadata/redpanda:latest")
     .kafkaHostPortRange(9300, 10)
     .build();
 
  • Method Details

    • builder

      public static MskConfig.Builder builder()
      Returns a new MskConfig.Builder for this configuration.
      Returns:
      a new builder
    • toBuilder

      public MskConfig.Builder toBuilder()
      Returns a new MskConfig.Builder for this configuration, initialized with the current values of this instance.
      Specified by:
      toBuilder in class AbstractServiceConfig<MskConfig.Builder>
      Returns:
      a new builder pre-populated with this configuration's values
    • isMock

      public boolean isMock()
      Returns whether MSK clusters are simulated in-memory without real Docker containers.
      Returns:
      true if mock mode is enabled
    • getDefaultImage

      public String getDefaultImage()
      Returns the default Docker image used for MSK (Redpanda) instances.
      Returns:
      the image name
    • getKafkaHostPortBase

      public int getKafkaHostPortBase()
      Returns the base port for the MSK Kafka broker host port range.
      Returns:
      the base port
    • getKafkaHostPortsCount

      public int getKafkaHostPortsCount()
      Returns the number of ports allocated for MSK Kafka brokers, starting from getKafkaHostPortBase().
      Returns:
      the number of Kafka host ports
    • getKafkaHostPortMax

      public int getKafkaHostPortMax()
      Returns the maximum port for the MSK Kafka broker host port range.
      Returns:
      the maximum port
    • applyEnvVarsToContainer

      public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by setting the appropriate environment variables.
      Overrides:
      applyEnvVarsToContainer in class AbstractServiceConfig<MskConfig.Builder>
      Parameters:
      container - the container to configure
    • applyExposedPortsToContainer

      public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by exposing the appropriate ports.
      Overrides:
      applyExposedPortsToContainer in class AbstractServiceConfig<MskConfig.Builder>
      Parameters:
      container - the container to configure