Class MskConfig
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<MskConfig.Builder>
io.floci.testcontainers.config.services.MskConfig
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();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
DEFAULT_ENABLED -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by setting the appropriate environment variables.voidapplyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by exposing the appropriate ports.static MskConfig.Builderbuilder()Returns a newMskConfig.Builderfor this configuration.Returns the default Docker image used for MSK (Redpanda) instances.intReturns the base port for the MSK Kafka broker host port range.intReturns the maximum port for the MSK Kafka broker host port range.intReturns the number of ports allocated for MSK Kafka brokers, starting fromgetKafkaHostPortBase().booleanisMock()Returns whether MSK clusters are simulated in-memory without real Docker containers.Returns a newMskConfig.Builderfor this configuration, initialized with the current values of this instance.Methods inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
isEnabled
-
Method Details
-
builder
Returns a newMskConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newMskConfig.Builderfor this configuration, initialized with the current values of this instance.- Specified by:
toBuilderin classAbstractServiceConfig<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:
trueif mock mode is enabled
-
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 fromgetKafkaHostPortBase().- 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:AbstractServiceConfigApplies this service configuration to the given container by setting the appropriate environment variables.- Overrides:
applyEnvVarsToContainerin classAbstractServiceConfig<MskConfig.Builder>- Parameters:
container- the container to configure
-
applyExposedPortsToContainer
public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by exposing the appropriate ports.- Overrides:
applyExposedPortsToContainerin classAbstractServiceConfig<MskConfig.Builder>- Parameters:
container- the container to configure
-