enabled = Optional.empty();
diff --git a/extensions/apicurio-registry-avro/deployment/src/main/java/io/quarkus/apicurio/registry/avro/DevServicesApicurioRegistryProcessor.java b/extensions/schema-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java
similarity index 87%
rename from extensions/apicurio-registry-avro/deployment/src/main/java/io/quarkus/apicurio/registry/avro/DevServicesApicurioRegistryProcessor.java
rename to extensions/schema-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java
index 7456b684a2eb7..658ee0f385a85 100644
--- a/extensions/apicurio-registry-avro/deployment/src/main/java/io/quarkus/apicurio/registry/avro/DevServicesApicurioRegistryProcessor.java
+++ b/extensions/schema-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;
@@ -31,16 +32,14 @@
/**
* 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).
*/
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 CONFLUENT_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 +94,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 +116,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",
+ CONFLUENT_SCHEMA_REGISTRY_URL_CONFIG, baseUrl + "/apis/ccompat/v6");
}
private void shutdownApicurioRegistry() {
@@ -141,12 +142,18 @@ 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 (!hasKafkaChannelWithoutApicurioRegistry()) {
+ if (ConfigUtils.isPropertyPresent(CONFLUENT_SCHEMA_REGISTRY_URL_CONFIG)) {
+ log.debug("Not starting dev services for Apicurio Registry, " + CONFLUENT_SCHEMA_REGISTRY_URL_CONFIG
+ + " is configured.");
+ return null;
+ }
+
+ if (!hasKafkaChannelWithoutRegistry()) {
log.debug("Not starting dev services for Apicurio Registry, all the channels have a registry URL configured.");
return null;
}
@@ -159,9 +166,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,11 +178,11 @@ 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()));
});
}
- private boolean hasKafkaChannelWithoutApicurioRegistry() {
+ private boolean hasKafkaChannelWithoutRegistry() {
Config config = ConfigProvider.getConfig();
for (String name : config.getPropertyNames()) {
boolean isIncoming = name.startsWith("mp.messaging.incoming.");
@@ -185,7 +192,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/schema-registry/devservice/pom.xml b/extensions/schema-registry/devservice/pom.xml
new file mode 100644
index 0000000000000..218ab03ab9dff
--- /dev/null
+++ b/extensions/schema-registry/devservice/pom.xml
@@ -0,0 +1,22 @@
+
+
+
+ quarkus-schema-registry-parent
+ io.quarkus
+ 999-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ quarkus-schema-registry-devservice-parent
+ Quarkus - Schema Registry - DevService
+ pom
+
+
+ deployment
+ runtime
+
+
+
diff --git a/extensions/schema-registry/devservice/runtime/pom.xml b/extensions/schema-registry/devservice/runtime/pom.xml
new file mode 100644
index 0000000000000..a9008082c9df4
--- /dev/null
+++ b/extensions/schema-registry/devservice/runtime/pom.xml
@@ -0,0 +1,28 @@
+
+
+ 4.0.0
+
+
+ quarkus-schema-registry-devservice-parent
+ io.quarkus
+ 999-SNAPSHOT
+ ../pom.xml
+
+
+ quarkus-schema-registry-devservice
+ Quarkus - Schema Registry - DevService - Runtime
+
+
+
+ io.quarkus
+ quarkus-core
+
+
+ io.quarkus
+ quarkus-vertx
+
+
+
+
diff --git a/extensions/schema-registry/pom.xml b/extensions/schema-registry/pom.xml
new file mode 100644
index 0000000000000..ac5f78da15335
--- /dev/null
+++ b/extensions/schema-registry/pom.xml
@@ -0,0 +1,23 @@
+
+
+ 4.0.0
+
+
+ quarkus-extensions-parent
+ io.quarkus
+ 999-SNAPSHOT
+ ../pom.xml
+
+
+ quarkus-schema-registry-parent
+ Quarkus - Schema Registry Parent
+ pom
+
+
+ apicurio
+ confluent
+ devservice
+
+
diff --git a/extensions/smallrye-reactive-messaging-kafka/deployment/pom.xml b/extensions/smallrye-reactive-messaging-kafka/deployment/pom.xml
index 2b4f1d74e145a..d474778d76ddd 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