Skip to content

Commit

Permalink
Update to Apicurio Registry 2.1.1.Final and use Vert.x HTTP client
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesarnal authored and Ladicek committed Oct 25, 2021
1 parent cb24295 commit 49e56f1
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 13 deletions.
8 changes: 7 additions & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@
<log4j2-jboss-logmanager.version>1.0.0.Final</log4j2-jboss-logmanager.version>
<log4j-jboss-logmanager.version>1.2.2.Final</log4j-jboss-logmanager.version>
<avro.version>1.10.2</avro.version>
<apicurio-registry.version>2.0.1.Final</apicurio-registry.version>
<apicurio-registry.version>2.1.1.Final</apicurio-registry.version>
<apicurio-common-rest-client.version>0.0.9.Final</apicurio-common-rest-client.version> <!-- must be the version Apicurio Registry uses -->
<jacoco.version>0.8.7</jacoco.version>
<testcontainers.version>1.16.2</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
<docker-java.version>3.2.12</docker-java.version> <!-- must be the version Testcontainers use -->
Expand Down Expand Up @@ -3006,6 +3007,11 @@
<artifactId>apicurio-registry-serdes-avro-serde</artifactId>
<version>${apicurio-registry.version}</version>
</dependency>
<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-common-rest-client-vertx</artifactId>
<version>${apicurio-common-rest-client.version}</version>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/kafka-schema-registry-avro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ services:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
schema-registry:
image: apicurio/apicurio-registry-mem:2.0.1.Final
image: apicurio/apicurio-registry-mem:2.1.1.Final
ports:
- 8081:8080
depends_on:
Expand Down Expand Up @@ -607,7 +607,7 @@ public class KafkaAndSchemaRegistryTestResource implements QuarkusTestResourceLi
@Override
public Map<String, String> start() {
kafka.start();
registry = new GenericContainer<>("apicurio/apicurio-registry-mem:2.0.1.Final")
registry = new GenericContainer<>("apicurio/apicurio-registry-mem:2.1.1.Final")
.withExposedPorts(8080)
.withEnv("QUARKUS_PROFILE", "prod");
registry.start();
Expand Down
2 changes: 1 addition & 1 deletion extensions/apicurio-registry-avro/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-apache-httpclient-deployment</artifactId>
<artifactId>quarkus-vertx-deployment</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import io.quarkus.deployment.Feature;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.vertx.deployment.VertxBuildItem;

public class ApicurioRegistryAvroProcessor {
@BuildStep
Expand Down Expand Up @@ -35,10 +38,11 @@ public void apicurioRegistryAvro(BuildProducer<ReflectiveClassBuildItem> reflect
"io.apicurio.registry.serde.Legacy4ByteIdHandler",
"io.apicurio.registry.serde.fallback.DefaultFallbackArtifactProvider",
"io.apicurio.registry.serde.headers.DefaultHeadersHandler"));
}

// Apicurio Registry 2.x uses the JDK 11 HTTP client, which unconditionally requires SSL
// TODO when the new HTTP client SPI in Apicurio Registry client appears, this will no longer be needed
// (but we'll have to make sure that the Vert.x HTTP client is used)
sslNativeSupport.produce(new ExtensionSslNativeSupportBuildItem(Feature.APICURIO_REGISTRY_AVRO));
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
public void apicurioRegistryClient(VertxBuildItem vertx, ApicurioRegistryClient client) {
client.setup(vertx.getVertx());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ApicurioRegistryDevServicesBuildTimeConfig {
* The Apicurio Registry image to use.
* Note that only Apicurio Registry 2.x images are supported.
*/
@ConfigItem(defaultValue = "apicurio/apicurio-registry-mem:2.0.1.Final")
@ConfigItem(defaultValue = "apicurio/apicurio-registry-mem:2.1.1.Final")
public String imageName;

/**
Expand Down
13 changes: 11 additions & 2 deletions extensions/apicurio-registry-avro/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-registry-serdes-avro-serde</artifactId>
<exclusions>
<exclusion>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-common-rest-client-jdk</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-common-rest-client-vertx</artifactId>
</dependency>

<dependency>
Expand All @@ -27,10 +37,9 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-avro</artifactId>
</dependency>
<!-- Apicurio Registry libraries use Keycloak client, which requires Apache HTTP Client -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-apache-httpclient</artifactId>
<artifactId>quarkus-vertx</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.apicurio.registry.avro;

import io.apicurio.registry.rest.client.RegistryClientFactory;
import io.apicurio.rest.client.VertxHttpClientProvider;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.annotations.Recorder;
import io.vertx.core.Vertx;

@Recorder
public class ApicurioRegistryClient {
public void setup(RuntimeValue<Vertx> vertx) {
RegistryClientFactory.setProvider(new VertxHttpClientProvider(vertx.getValue()));
}
}
2 changes: 1 addition & 1 deletion integration-tests/kafka-avro-apicurio2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
-->

<properties>
<apicurio.version>2.0.1.Final</apicurio.version>
<apicurio.version>2.1.1.Final</apicurio.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static String getApicurioSchemaRegistryUrl() {
@Override
public Map<String, String> start() {
kafka.start();
registry = new GenericContainer<>("apicurio/apicurio-registry-mem:2.0.1.Final")
registry = new GenericContainer<>("apicurio/apicurio-registry-mem:2.1.1.Final")
.withExposedPorts(8080)
.withEnv("QUARKUS_PROFILE", "prod");
registry.start();
Expand Down

0 comments on commit 49e56f1

Please sign in to comment.