-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Add extension for Apicurio Registry Avro
- Loading branch information
Showing
13 changed files
with
466 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-apicurio-registry-avro-parent</artifactId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>quarkus-apicurio-registry-avro-deployment</artifactId> | ||
<name>Quarkus - Apicurio Registry - Avro - Deployment</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-apicurio-registry-avro</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core-deployment</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>testcontainers</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5-internal</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${project.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
44 changes: 44 additions & 0 deletions
44
...oyment/src/main/java/io/quarkus/apicurio/registry/avro/ApicurioRegistryAvroProcessor.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,44 @@ | ||
package io.quarkus.apicurio.registry.avro; | ||
|
||
import io.quarkus.deployment.Feature; | ||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; | ||
import io.quarkus.deployment.builditem.FeatureBuildItem; | ||
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; | ||
|
||
public class ApicurioRegistryAvroProcessor { | ||
@BuildStep | ||
FeatureBuildItem feature() { | ||
return new FeatureBuildItem(Feature.APICURIO_REGISTRY_AVRO); | ||
} | ||
|
||
@BuildStep | ||
public void apicurioRegistryAvro(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, | ||
BuildProducer<ExtensionSslNativeSupportBuildItem> sslNativeSupport) { | ||
|
||
reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, false, | ||
"io.apicurio.registry.serde.avro.AvroKafkaDeserializer", | ||
"io.apicurio.registry.serde.avro.AvroKafkaSerializer")); | ||
|
||
reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, false, | ||
"io.apicurio.registry.serde.strategy.SimpleTopicIdStrategy", | ||
"io.apicurio.registry.serde.strategy.TopicIdStrategy", | ||
"io.apicurio.registry.serde.avro.DefaultAvroDatumProvider", | ||
"io.apicurio.registry.serde.avro.ReflectAvroDatumProvider", | ||
"io.apicurio.registry.serde.avro.strategy.RecordIdStrategy", | ||
"io.apicurio.registry.serde.avro.strategy.TopicRecordIdStrategy")); | ||
|
||
reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, false, | ||
"io.apicurio.registry.serde.DefaultSchemaResolver", | ||
"io.apicurio.registry.serde.DefaultIdHandler", | ||
"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)); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...in/java/io/quarkus/apicurio/registry/avro/ApicurioRegistryDevServicesBuildTimeConfig.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.apicurio.registry.avro; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
|
||
@ConfigRoot(name = "apicurio-registry.devservices", phase = ConfigPhase.BUILD_TIME) | ||
public class ApicurioRegistryDevServicesBuildTimeConfig { | ||
|
||
/** | ||
* If Dev Services for Apicurio Registry has been explicitly enabled or disabled. Dev Services are generally enabled | ||
* by default, unless there is an existing configuration present. | ||
*/ | ||
@ConfigItem | ||
public Optional<Boolean> enabled = Optional.empty(); | ||
|
||
/** | ||
* Optional fixed port the dev service will listen to. | ||
* <p> | ||
* If not defined, the port will be chosen randomly. | ||
*/ | ||
@ConfigItem | ||
public Optional<Integer> port; | ||
|
||
/** | ||
* The Apicurio Registry image to use. | ||
* Note that only Apicurio Registry 2.x images are supported. | ||
*/ | ||
@ConfigItem(defaultValue = "apicurio/apicurio-registry-mem:2.0.0.Final") | ||
public String imageName; | ||
|
||
} |
Oops, something went wrong.