You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: The error described in this issue can easily be avoided. I am just creating this issue to inform you about a regression issue, which was not expected from a minor version update.
We are using KafkaContainer together with a custom SchemaRegistryContainer for our Spring Boot Integration-Tests.
In order to connect both, we define a Network for the KafkaContainer and configure the SchemaRegistryContainer to use the same network with a network alias set as SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS url:
@Testcontainers
class KafkaContainerInitializer : ApplicationContextInitializer<ConfigurableApplicationContext> {
companion object {
private const val CONFLUENT_VERSION = "confluentinc/cp-kafka:7.0.10"
@Container
val kafkaContainer: KafkaContainer = KafkaContainer(DockerImageName.parse(CONFLUENT_VERSION))
.withNetwork(Network.newNetwork())
@Container
val schemaRegistryContainer: SchemaRegistryContainer =
SchemaRegistryContainer().withKafka(kafkaContainer)
}
override fun initialize(applicationContext: ConfigurableApplicationContext) {
kafkaContainer.start()
schemaRegistryContainer.start()
}
}
class SchemaRegistryContainer : GenericContainer<SchemaRegistryContainer>(
"confluentinc/cp-schema-registry:7.0.10"
) {
init {
withExposedPorts(8081)
}
fun withKafka(kafka: KafkaContainer): SchemaRegistryContainer {
return withKafka(kafka.network!!, "${kafka.networkAliases[0]}:9092")
}
private fun withKafka(network: Network, bootstrapServers: String): SchemaRegistryContainer {
withNetwork(network)
withEnv("SCHEMA_REGISTRY_HOST_NAME", "schema-registry")
withEnv("SCHEMA_REGISTRY_LISTENERS", "http://0.0.0.0:8081")
withEnv("SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS", "PLAINTEXT://$bootstrapServers")
return this
}
}
After the update to version 1.19.2 kafka.networkAliases[0] throws a IndexOutOfBoundsException because no network alias is configured. This is likely related to this commit: #7748
It can easily be fixed by setting an alias explicitly using the withNetworkAliases method but, as pointed out, such a regression issue was not expected by a minor version update. Therefore, and to make sure no other issues occurred with the change, I'm opening this bug.
Relevant log output
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Changes in 1dba8d1 doesn't register a default network alias
when implementing the new `ContainerDef`. This impacts to
kafka and mongodb modules.
Fixes#7823
Changes in 1dba8d1 doesn't register a default network alias
when implementing the new `ContainerDef`. This impacts to
kafka and mongodb modules.
Fixes#7823
I'll try and get a new bug reported raised if required.
I made the changes in my code to use the .withNetworkAlias against 1.19.2 which got past this index out of bounds error but I then get problems on the kafka-streams health check failing.
Timed out waiting for node assignment. Call: listTopics
Again works fine on my work MacOS laptop but fails on the Ubuntu GHA runner we have.
1.19.1 worked fine, I'll try and get time towards the end of the week to make a reproducible version on my Linux laptop
Module
Kafka
Testcontainers version
1.19.2
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host Arch
x86
Docker version
What happened?
Disclaimer: The error described in this issue can easily be avoided. I am just creating this issue to inform you about a regression issue, which was not expected from a minor version update.
We are using KafkaContainer together with a custom SchemaRegistryContainer for our Spring Boot Integration-Tests.
In order to connect both, we define a Network for the KafkaContainer and configure the SchemaRegistryContainer to use the same network with a network alias set as
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS
url:After the update to version 1.19.2
kafka.networkAliases[0]
throws a IndexOutOfBoundsException because no network alias is configured. This is likely related to this commit: #7748It can easily be fixed by setting an alias explicitly using the
withNetworkAliases
method but, as pointed out, such a regression issue was not expected by a minor version update. Therefore, and to make sure no other issues occurred with the change, I'm opening this bug.Relevant log output
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: