enabled = Optional.empty();
diff --git a/extensions/apicurio-registry-avro/deployment/src/main/java/io/quarkus/apicurio/registry/avro/DevServicesApicurioRegistryProcessor.java b/extensions/apicurio-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java
similarity index 88%
rename from extensions/apicurio-registry-avro/deployment/src/main/java/io/quarkus/apicurio/registry/avro/DevServicesApicurioRegistryProcessor.java
rename to extensions/apicurio-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java
index 7456b684a2eb7f..ea81adf57b8678 100644
--- a/extensions/apicurio-registry-avro/deployment/src/main/java/io/quarkus/apicurio/registry/avro/DevServicesApicurioRegistryProcessor.java
+++ b/extensions/apicurio-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java
@@ -1,7 +1,8 @@
-package io.quarkus.apicurio.registry.avro;
+package io.quarkus.apicurio.registry.devservice;
import java.time.Duration;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.Optional;
@@ -33,14 +34,15 @@
* Starts Apicurio Registry as dev service if needed.
*
* In the future, when we have multiple Apicurio Registry extensions (Avro, Protobuf, ...),
- * this dev service support should probably be moved into an extra extension (quarkus-apicurio-registry-internal).
+ * this dev service support should probably be moved into an extra extension (quarkus-apicurio-registry-base).
*/
public class DevServicesApicurioRegistryProcessor {
private static final Logger log = Logger.getLogger(DevServicesApicurioRegistryProcessor.class);
private static final int APICURIO_REGISTRY_PORT = 8080; // inside the container
- private static final String REGISTRY_URL_CONFIG = "mp.messaging.connector.smallrye-kafka.apicurio.registry.url";
+ private static final String APLICURIO_REGISTRY_URL_CONFIG = "mp.messaging.connector.smallrye-kafka.apicurio.registry.url";
+ private static final String SCHEMA_REGISTRY_URL_CONFIG = "mp.messaging.connector.smallrye-kafka.schema.registry.url";
/**
* Label to add to shared Dev Service for Apicurio Registry running in containers.
@@ -95,7 +97,7 @@ public DevServicesResultBuildItem startApicurioRegistryDevService(LaunchModeBuil
if (devService.isOwner()) {
log.infof("Dev Services for Apicurio Registry started. The registry is available at %s",
- devService.getConfig().get(REGISTRY_URL_CONFIG));
+ devService.getConfig().get(APLICURIO_REGISTRY_URL_CONFIG));
}
// Configure the watch dog
@@ -117,8 +119,10 @@ public void run() {
return devService.toBuildItem();
}
- private String getRegistryUrlConfig(String baseUrl) {
- return baseUrl + "/apis/registry/v2";
+ private Map getRegistryUrlConfigs(String baseUrl) {
+ return Map.of(
+ APLICURIO_REGISTRY_URL_CONFIG, baseUrl + "/apis/registry/v2",
+ SCHEMA_REGISTRY_URL_CONFIG, baseUrl + "/apis/ccompat/v6");
}
private void shutdownApicurioRegistry() {
@@ -141,8 +145,13 @@ private RunningDevService startApicurioRegistry(ApicurioRegistryDevServiceCfg co
return null;
}
- if (ConfigUtils.isPropertyPresent(REGISTRY_URL_CONFIG)) {
- log.debug("Not starting dev services for Apicurio Registry, " + REGISTRY_URL_CONFIG + " is configured.");
+ if (ConfigUtils.isPropertyPresent(APLICURIO_REGISTRY_URL_CONFIG)) {
+ log.debug("Not starting dev services for Apicurio Registry, " + APLICURIO_REGISTRY_URL_CONFIG + " is configured.");
+ return null;
+ }
+
+ if (ConfigUtils.isPropertyPresent(SCHEMA_REGISTRY_URL_CONFIG)) {
+ log.debug("Not starting dev services for Apicurio Registry, " + SCHEMA_REGISTRY_URL_CONFIG + " is configured.");
return null;
}
@@ -159,9 +168,9 @@ private RunningDevService startApicurioRegistry(ApicurioRegistryDevServiceCfg co
// Starting the broker
return apicurioRegistryContainerLocator.locateContainer(config.serviceName, config.shared, launchMode.getLaunchMode())
.map(address -> new RunningDevService(Feature.APICURIO_REGISTRY_AVRO.getName(),
- address.getId(), null, REGISTRY_URL_CONFIG,
+ address.getId(), null,
// address does not have the URL Scheme - just the host:port, so prepend http://
- getRegistryUrlConfig("http://" + address.getUrl())))
+ getRegistryUrlConfigs("http://" + address.getUrl())))
.orElseGet(() -> {
ApicurioRegistryContainer container = new ApicurioRegistryContainer(
DockerImageName.parse(config.imageName), config.fixedExposedPort,
@@ -171,7 +180,7 @@ private RunningDevService startApicurioRegistry(ApicurioRegistryDevServiceCfg co
container.start();
return new RunningDevService(Feature.APICURIO_REGISTRY_AVRO.getName(), container.getContainerId(),
- container::close, REGISTRY_URL_CONFIG, getRegistryUrlConfig(container.getUrl()));
+ container::close, getRegistryUrlConfigs(container.getUrl()));
});
}
@@ -185,7 +194,8 @@ private boolean hasKafkaChannelWithoutApicurioRegistry() {
&& "smallrye-kafka".equals(config.getOptionalValue(name, String.class).orElse("ignored"));
boolean isConfigured = false;
if ((isIncoming || isOutgoing) && isKafka) {
- isConfigured = ConfigUtils.isPropertyPresent(name.replace(".connector", ".apicurio.registry.url"));
+ isConfigured = ConfigUtils.isPropertyPresent(name.replace(".connector", ".apicurio.registry.url")) ||
+ ConfigUtils.isPropertyPresent(name.replace(".connector", ".schema.registry.url"));
}
if (!isConfigured) {
return true;
diff --git a/extensions/apicurio-registry/devservice/pom.xml b/extensions/apicurio-registry/devservice/pom.xml
new file mode 100644
index 00000000000000..8f0f06834334ba
--- /dev/null
+++ b/extensions/apicurio-registry/devservice/pom.xml
@@ -0,0 +1,22 @@
+
+
+
+ quarkus-apicurio-registry
+ io.quarkus
+ 999-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ quarkus-apicurio-registry-devservice-parent
+ Quarkus - Apicurio Registry - DevService
+ pom
+
+
+ deployment
+ runtime
+
+
+
diff --git a/extensions/apicurio-registry/devservice/runtime/pom.xml b/extensions/apicurio-registry/devservice/runtime/pom.xml
new file mode 100644
index 00000000000000..fca635dd041da6
--- /dev/null
+++ b/extensions/apicurio-registry/devservice/runtime/pom.xml
@@ -0,0 +1,42 @@
+
+
+ 4.0.0
+
+
+ quarkus-apicurio-registry-devservice-parent
+ io.quarkus
+ 999-SNAPSHOT
+ ../pom.xml
+
+
+ quarkus-apicurio-registry-devservice
+ Quarkus - Apicurio Registry - DevService Runtime
+
+
+
+ io.quarkus
+ quarkus-kubernetes-service-binding
+ true
+
+
+
+ io.quarkus
+ quarkus-core
+
+
+ io.quarkus
+ quarkus-avro
+
+
+ io.quarkus
+ quarkus-vertx
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+
diff --git a/extensions/apicurio-registry-avro/runtime/src/main/java/io/quarkus/apicurio/registry/binding/ServiceRegistryBindingConverter.java b/extensions/apicurio-registry/devservice/runtime/src/main/java/io/quarkus/apicurio/registry/binding/ServiceRegistryBindingConverter.java
similarity index 100%
rename from extensions/apicurio-registry-avro/runtime/src/main/java/io/quarkus/apicurio/registry/binding/ServiceRegistryBindingConverter.java
rename to extensions/apicurio-registry/devservice/runtime/src/main/java/io/quarkus/apicurio/registry/binding/ServiceRegistryBindingConverter.java
diff --git a/extensions/apicurio-registry-avro/runtime/src/main/resources/META-INF/services/io.quarkus.kubernetes.service.binding.runtime.ServiceBindingConverter b/extensions/apicurio-registry/devservice/runtime/src/main/resources/META-INF/services/io.quarkus.kubernetes.service.binding.runtime.ServiceBindingConverter
similarity index 100%
rename from extensions/apicurio-registry-avro/runtime/src/main/resources/META-INF/services/io.quarkus.kubernetes.service.binding.runtime.ServiceBindingConverter
rename to extensions/apicurio-registry/devservice/runtime/src/main/resources/META-INF/services/io.quarkus.kubernetes.service.binding.runtime.ServiceBindingConverter
diff --git a/extensions/apicurio-registry/pom.xml b/extensions/apicurio-registry/pom.xml
new file mode 100644
index 00000000000000..2a83a6efd0e647
--- /dev/null
+++ b/extensions/apicurio-registry/pom.xml
@@ -0,0 +1,22 @@
+
+
+
+ quarkus-extensions-parent
+ io.quarkus
+ 999-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ quarkus-apicurio-registry
+ Quarkus - Apicurio Registry
+ pom
+
+
+ devservice
+ apicurio
+ confluent
+
+
diff --git a/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/KafkaProcessor.java b/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/KafkaProcessor.java
index 6f508df693bc26..ac222e13e0d6ec 100644
--- a/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/KafkaProcessor.java
+++ b/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/KafkaProcessor.java
@@ -347,55 +347,13 @@ private void handleAvro(BuildProducer reflectiveClass,
try {
Class.forName("io.confluent.kafka.serializers.KafkaAvroDeserializer", false,
Thread.currentThread().getContextClassLoader());
- reflectiveClass
- .produce(new ReflectiveClassBuildItem(true, false,
- "io.confluent.kafka.serializers.KafkaAvroDeserializer",
- "io.confluent.kafka.serializers.KafkaAvroSerializer"));
-
- reflectiveClass
- .produce(new ReflectiveClassBuildItem(true, false, false,
- "io.confluent.kafka.serializers.context.NullContextNameStrategy"));
-
- reflectiveClass
- .produce(new ReflectiveClassBuildItem(true, true, false,
- "io.confluent.kafka.serializers.subject.TopicNameStrategy",
- "io.confluent.kafka.serializers.subject.TopicRecordNameStrategy",
- "io.confluent.kafka.serializers.subject.RecordNameStrategy"));
-
- reflectiveClass
- .produce(new ReflectiveClassBuildItem(true, true, false,
- "io.confluent.kafka.schemaregistry.client.rest.entities.ErrorMessage",
- "io.confluent.kafka.schemaregistry.client.rest.entities.Schema",
- "io.confluent.kafka.schemaregistry.client.rest.entities.Config",
- "io.confluent.kafka.schemaregistry.client.rest.entities.SchemaReference",
- "io.confluent.kafka.schemaregistry.client.rest.entities.SchemaString",
- "io.confluent.kafka.schemaregistry.client.rest.entities.SchemaTypeConverter",
- "io.confluent.kafka.schemaregistry.client.rest.entities.ServerClusterId",
- "io.confluent.kafka.schemaregistry.client.rest.entities.SujectVersion"));
-
- reflectiveClass
- .produce(new ReflectiveClassBuildItem(true, true, false,
- "io.confluent.kafka.schemaregistry.client.rest.entities.requests.CompatibilityCheckResponse",
- "io.confluent.kafka.schemaregistry.client.rest.entities.requests.ConfigUpdateRequest",
- "io.confluent.kafka.schemaregistry.client.rest.entities.requests.ModeGetResponse",
- "io.confluent.kafka.schemaregistry.client.rest.entities.requests.ModeUpdateRequest",
- "io.confluent.kafka.schemaregistry.client.rest.entities.requests.RegisterSchemaRequest",
- "io.confluent.kafka.schemaregistry.client.rest.entities.requests.RegisterSchemaResponse"));
- } catch (ClassNotFoundException e) {
- //ignore, Confluent Avro is not in the classpath
- }
- try {
- Class.forName("io.confluent.kafka.schemaregistry.client.security.basicauth.BasicAuthCredentialProvider", false,
- Thread.currentThread().getContextClassLoader());
- serviceProviders
- .produce(new ServiceProviderBuildItem(
- "io.confluent.kafka.schemaregistry.client.security.basicauth.BasicAuthCredentialProvider",
- "io.confluent.kafka.schemaregistry.client.security.basicauth.SaslBasicAuthCredentialProvider",
- "io.confluent.kafka.schemaregistry.client.security.basicauth.UrlBasicAuthCredentialProvider",
- "io.confluent.kafka.schemaregistry.client.security.basicauth.UserInfoCredentialProvider"));
+ if (!capabilities.isPresent(Capability.CONFLUENT_REGISTRY_AVRO)) {
+ throw new RuntimeException(
+ "Confluent Avro classes detected, please use the quarkus-apicurio-registry-confluent-avro extension");
+ }
} catch (ClassNotFoundException e) {
- // ignore, Confluent schema registry client not in the classpath
+ // ignore, Confluent Avro is not in the classpath
}
// --- Apicurio Registry 1.x ---
diff --git a/extensions/pom.xml b/extensions/pom.xml
index dfa6b6d3793cf0..3ec965df18da03 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -99,7 +99,7 @@
kafka-streams
mongodb-client
avro
- apicurio-registry-avro
+ apicurio-registry
devservices
diff --git a/extensions/smallrye-reactive-messaging-kafka/deployment/pom.xml b/extensions/smallrye-reactive-messaging-kafka/deployment/pom.xml
index 2b4f1d74e145aa..ac96a3608736a9 100644
--- a/extensions/smallrye-reactive-messaging-kafka/deployment/pom.xml
+++ b/extensions/smallrye-reactive-messaging-kafka/deployment/pom.xml
@@ -73,6 +73,11 @@
quarkus-apicurio-registry-avro-deployment
test