public class ConfluentKafkaContainer extends org.testcontainers.containers.GenericContainer<ConfluentKafkaContainer>
Supported image: confluentinc/cp-kafka
Exposed ports: 9092
| Constructor and Description |
|---|
ConfluentKafkaContainer(org.testcontainers.utility.DockerImageName dockerImageName) |
ConfluentKafkaContainer(java.lang.String imageName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure() |
protected void |
containerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) |
java.lang.String |
getBootstrapServers() |
ConfluentKafkaContainer |
withListener(java.lang.String listener)
Add a listener in the format
host:port. |
ConfluentKafkaContainer |
withListener(java.lang.String listener,
java.util.function.Supplier<java.lang.String> advertisedListener)
Add a listener in the format
host:port and a Supplier for the advertised listener. |
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, failed, finished, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, stop, succeeded, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindcopyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunningpublic ConfluentKafkaContainer(java.lang.String imageName)
public ConfluentKafkaContainer(org.testcontainers.utility.DockerImageName dockerImageName)
protected void configure()
configure in class org.testcontainers.containers.GenericContainer<ConfluentKafkaContainer>protected void containerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
containerIsStarting in class org.testcontainers.containers.GenericContainer<ConfluentKafkaContainer>public ConfluentKafkaContainer withListener(java.lang.String listener)
host:port.
Host will be included as a network alias.
Use it to register additional connections to the Kafka broker within the same container network.
The listener will be added to the list of default listeners.
Default listeners:
The listener will be added to the list of default advertised listeners.
Default advertised listeners:
container.getConfig().getHostName():9092container.getHost():container.getMappedPort(9093)listener - a listener with format host:portConfluentKafkaContainer instancepublic ConfluentKafkaContainer withListener(java.lang.String listener, java.util.function.Supplier<java.lang.String> advertisedListener)
host:port and a Supplier for the advertised listener.
Host from listener will be included as a network alias.
Use it to register additional connections to the Kafka broker from outside the container network
The listener will be added to the list of default listeners.
Default listeners:
The Supplier will be added to the list of default advertised listeners.
Default advertised listeners:
container.getConfig().getHostName():9092container.getHost():container.getMappedPort(9093)listener - a supplier that will provide a listeneradvertisedListener - a supplier that will provide a listenerConfluentKafkaContainer instancepublic java.lang.String getBootstrapServers()