-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
107 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 3 additions & 24 deletions
27
...c/main/java/io/quarkus/test/services/containers/StrimziKafkaContainerManagedResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,27 @@ | ||
package io.quarkus.test.services.containers; | ||
|
||
import org.testcontainers.containers.GenericContainer; | ||
import org.testcontainers.containers.KafkaContainer; | ||
|
||
import io.strimzi.StrimziKafkaContainer; | ||
|
||
public class StrimziKafkaContainerManagedResource extends BaseKafkaContainerManagedResource { | ||
|
||
private static final String REGISTRY_IMAGE = "apicurio/apicurio-registry-mem:1.2.2.Final"; | ||
private static final int REGISTRY_PORT = 8080; | ||
private static final String REGISTRY_PATH = "/api"; | ||
private static final int KAFKA_PORT = 9092; | ||
|
||
protected StrimziKafkaContainerManagedResource(KafkaContainerManagedResourceBuilder model) { | ||
super(model); | ||
} | ||
|
||
@Override | ||
protected int getTargetPort() { | ||
return KAFKA_PORT; | ||
} | ||
|
||
@Override | ||
protected int getRegistryTargetPort() { | ||
return REGISTRY_PORT; | ||
} | ||
|
||
@Override | ||
protected GenericContainer<?> initKafkaContainer() { | ||
return new StrimziKafkaContainer(getKafkaVersion()); | ||
} | ||
|
||
@Override | ||
protected GenericContainer<?> initRegistryContainer(GenericContainer<?> kafka) { | ||
GenericContainer<?> schemaRegistry = new GenericContainer<>(REGISTRY_IMAGE); | ||
schemaRegistry.withExposedPorts(REGISTRY_PORT); | ||
GenericContainer<?> schemaRegistry = new GenericContainer<>(getKafkaRegistryImage()); | ||
schemaRegistry.withExposedPorts(getKafkaRegistryPort()); | ||
schemaRegistry.withEnv("APPLICATION_ID", "registry_id"); | ||
schemaRegistry.withEnv("APPLICATION_SERVER", "localhost:9000"); | ||
schemaRegistry.withEnv("KAFKA_BOOTSTRAP_SERVERS", "PLAINTEXT://localhost:" + KafkaContainer.KAFKA_PORT); | ||
schemaRegistry.withEnv("KAFKA_BOOTSTRAP_SERVERS", "PLAINTEXT://localhost:" + getTargetPort()); | ||
return schemaRegistry; | ||
} | ||
|
||
@Override | ||
protected String getRegistryPath() { | ||
return REGISTRY_PATH; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...-service-kafka/src/main/java/io/quarkus/test/services/containers/model/KafkaRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.quarkus.test.services.containers.model; | ||
|
||
public enum KafkaRegistry { | ||
CONFLUENT("confluentinc/cp-schema-registry", "6.1.1", "/", 8081), | ||
APICURIO("quay.io/apicurio/apicurio-registry-mem", "2.0.0.Final", "/api", 8080); | ||
|
||
private final String image; | ||
private final String defaultVersion; | ||
private final String path; | ||
private final int port; | ||
|
||
KafkaRegistry(String image, String defaultVersion, String path, int port) { | ||
this.image = image; | ||
this.defaultVersion = defaultVersion; | ||
this.path = path; | ||
this.port = port; | ||
} | ||
|
||
public String getImage() { | ||
return image; | ||
} | ||
|
||
public String getDefaultVersion() { | ||
return defaultVersion; | ||
} | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public int getPort() { | ||
return port; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters