Skip to content

Commit

Permalink
perf: Use kafka-native container image for Kafka only ITs
Browse files Browse the repository at this point in the history
  • Loading branch information
selamanse authored and fhussonnois committed Nov 6, 2024
1 parent a8903fa commit e04e076
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<!-- Tests -->
<junit.version>5.10.0</junit.version>
<junit-bom.version>5.10.2</junit-bom.version>
<testcontainer.version>1.19.8</testcontainer.version>
<testcontainer.version>1.20.2</testcontainer.version>
<!-- Dependencies -->
<kafka.version>3.7.0</kafka.version>
<picocli.version>4.7.6</picocli.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import org.junit.jupiter.api.TestMethodOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.KafkaContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.kafka.KafkaContainer;
import org.testcontainers.utility.DockerImageName;

@Testcontainers
Expand All @@ -35,14 +35,13 @@ public class AbstractKafkaIntegrationTest {
private static final Logger LOG = LoggerFactory.getLogger(AbstractKafkaIntegrationTest.class);
private static final Network KAFKA_NETWORK = Network.newNetwork();

public static final String CONFLUENT_PLATFORM_VERSION = "7.4.0";
public static final String APACHE_KAFKA_VERSION = "3.8.0";
public static final int DEFAULT_NUM_PARTITIONS = 1;
public static final short DEFAULT_REPLICATION_FACTOR = (short) 1;

@Container
final KafkaContainer kafka = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka").withTag(CONFLUENT_PLATFORM_VERSION))
.withKraft()
DockerImageName.parse("apache/kafka-native").withTag(APACHE_KAFKA_VERSION))
.withNetwork(KAFKA_NETWORK)
.withEnv("KAFKA_TRANSACTION_STATE_LOG_MIN_ISR", "1")
.withEnv("KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR", "1")
Expand Down

0 comments on commit e04e076

Please sign in to comment.