You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2025/08/21 07:37:58 UTC
Re: [PR] support allowing to test with confluent v7 and v8 docker images [pekko-connectors-kafka]
Copilot commented on code in PR #332:
URL: https://github.com/apache/pekko-connectors-kafka/pull/332#discussion_r2290162512
##########
testkit/src/main/java/org/apache/pekko/kafka/testkit/internal/KafkaContainerCluster.java:
##########
@@ -111,31 +111,42 @@ public KafkaContainerCluster(
this.network = Network.newNetwork();
this.schemaRegistryImage = schemaRegistryImage;
- this.zookeeper =
- new GenericContainer(zooKeeperImage)
- .withNetwork(network)
- .withNetworkAliases("zookeeper")
- .withEnv(
- "ZOOKEEPER_CLIENT_PORT",
- String.valueOf(PekkoConnectorsKafkaContainer.ZOOKEEPER_PORT));
+ if (!PekkoConnectorsKafkaContainer.DEFAULT_CONFLUENT_PLATFORM_VERSION.startsWith("8.")) {
Review Comment:
The hardcoded version check "8." is fragile and will need updates for future versions. Consider using a more robust version parsing approach or configuration-based approach to determine ZooKeeper requirements.
```suggestion
if (getMajorVersion(PekkoConnectorsKafkaContainer.DEFAULT_CONFLUENT_PLATFORM_VERSION) < 8) {
```
##########
tests/src/test/scala/org/apache/pekko/kafka/scaladsl/RetentionPeriodSpec.scala:
##########
@@ -31,7 +31,8 @@ import scala.concurrent.duration._
class RetentionPeriodSpec extends SpecBase with TestcontainersKafkaPerClassLike {
// https://docs.confluent.io/current/installation/versions-interoperability.html
- private final val confluentPlatformVersion = "7.9.2"
+ private final val confluentPlatformVersion =
+ System.getProperty("CONFLUENT_PLATFORM_VERSION", "7.9.2");
Review Comment:
Remove the trailing semicolon as it's not needed in Scala.
```suggestion
System.getProperty("CONFLUENT_PLATFORM_VERSION", "7.9.2")
```
##########
testkit/src/main/java/org/apache/pekko/kafka/testkit/internal/KafkaContainerCluster.java:
##########
@@ -111,31 +111,42 @@ public KafkaContainerCluster(
this.network = Network.newNetwork();
this.schemaRegistryImage = schemaRegistryImage;
- this.zookeeper =
- new GenericContainer(zooKeeperImage)
- .withNetwork(network)
- .withNetworkAliases("zookeeper")
- .withEnv(
- "ZOOKEEPER_CLIENT_PORT",
- String.valueOf(PekkoConnectorsKafkaContainer.ZOOKEEPER_PORT));
+ if (!PekkoConnectorsKafkaContainer.DEFAULT_CONFLUENT_PLATFORM_VERSION.startsWith("8.")) {
+ this.zookeeper =
+ Optional.of(
+ new GenericContainer(zooKeeperImage)
+ .withNetwork(network)
+ .withNetworkAliases("zookeeper")
+ .withEnv(
+ "ZOOKEEPER_CLIENT_PORT",
+ String.valueOf(PekkoConnectorsKafkaContainer.ZOOKEEPER_PORT)));
Review Comment:
[nitpick] The indentation is inconsistent with the rest of the method. This line should align with the previous withEnv call.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org