Skip to content

Commit

Permalink
Add extension for Apicurio Registry Avro
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladicek committed Jun 9, 2021
1 parent 7249369 commit d9d50a2
Show file tree
Hide file tree
Showing 21 changed files with 761 additions and 189 deletions.
16 changes: 16 additions & 0 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
<log4j2-jboss-logmanager.version>1.0.0.Final</log4j2-jboss-logmanager.version>
<log4j-jboss-logmanager.version>1.2.0.Final</log4j-jboss-logmanager.version>
<avro.version>1.10.2</avro.version>
<apicurio-registry.version>2.0.0.Final</apicurio-registry.version>
<jacoco.version>0.8.7</jacoco.version>
<testcontainers.version>1.15.3</testcontainers.version>
<docker-java.version>3.2.8</docker-java.version> <!-- must be the version Testcontainers use -->
Expand Down Expand Up @@ -1106,6 +1107,16 @@
<artifactId>quarkus-avro-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-apicurio-registry-avro</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-apicurio-registry-avro-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
Expand Down Expand Up @@ -2844,6 +2855,11 @@
<artifactId>agroal-pool</artifactId>
<version>${agroal.version}</version>
</dependency>
<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-registry-serdes-avro-serde</artifactId>
<version>${apicurio-registry.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public enum Feature {
AMAZON_SES,
AMAZON_KMS,
AMAZON_SSM,
APICURIO_REGISTRY_AVRO,
ARTEMIS_CORE,
ARTEMIS_JMS,
CACHE,
Expand Down
13 changes: 13 additions & 0 deletions devtools/bom-descriptor-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-apicurio-registry-avro</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-apicurio-registry-avro-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc-deployment</artifactId>
Expand Down
41 changes: 41 additions & 0 deletions docs/src/main/asciidoc/apicurio-registry-dev-services.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
////
This guide is maintained in the main Quarkus repository
and pull requests should be submitted there:
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
////
= Dev Services for Apicurio Registry

include::./attributes.adoc[]

If the `quarkus-apicurio-registry-avro` extension is present, Dev Services for Apicurio Registry automatically starts an Apicurio Registry instance in dev mode and when running tests.
Also, all Kafka channels in SmallRye Reactive Messaging are automatically configured to use this registry.
(This automatic configuration of course only applies to serializers and deserializers from the Apicurio Registry Avro library.)

== Enabling / Disabling Dev Services for Apicurio Registry

Dev Services for Apicurio Registry is automatically enabled unless:

- `quarkus.apicurio-registry.devservices.enabled` is set to `false`
- `mp.messaging.connector.smallrye-kafka.apicurio.registry.url` is configured
- all the Reactive Messaging Kafka channels have the `apicurio.registry.url` attribute set

Dev Services for Apicurio Registry relies on Docker to start the registry.
If your environment does not support Docker, you will need to start the registry manually, or use an already running registry.
You can configure the registry URL for all Kafka channels in SmallRye Reactive Messaging with a single property:

[source,properties]
----
mp.messaging.connector.smallrye-kafka.apicurio.registry.url=http://localhost:8081/apis/registry/v2
----

== Setting the port

By default, Dev Services for Apicurio Registry picks a random port and configure the application.
You can set the port by configuring the `quarkus.apicurio-registry.devservices.port` property.

Note that the Kafka channels in SmallRye Reactive messaging are automatically configured with the chosen port.

== Configuring the image

By default, Dev Services for Apicurio Registry uses `apicurio/apicurio-registry-mem:2.0.0.Final`.
Any 2.x version of Apicurio Registry can be used by setting the `quarkus.apicurio-registry.devservices.image-name` configuration property.
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/kafka-dev-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc

include::./attributes.adoc[]

Dev Services for Kafka automatically starts a Kafka broker in dev mode and when running tests.
If any Kafka-related extension is present (e.g. `quarkus-smallrye-reactive-messaging-kafka`), Dev Services for Kafka automatically starts a Kafka broker in dev mode and when running tests.
So, you don't have to start a broker manually.
The application is configured automatically.

IMPORTANT: Because starting a Kafka broker can be long, Dev Services for Kafka uses https://vectorized.io/redpanda[Red Panda], a Kafka compatible broker which starts in ~1 second.
IMPORTANT: Because starting a Kafka broker can be long, Dev Services for Kafka uses https://vectorized.io/redpanda[Redpanda], a Kafka compatible broker which starts in ~1 second.

== Enabling / Disabling Dev Services for Kafka

Expand All @@ -35,6 +35,6 @@ Note that the Kafka advertised address is automatically configured with the chos
== Configuring the image

By default, Dev Services for Kafka uses: `vectorized/redpanda:latest`.
You can select any version from https://hub.docker.com/r/vectorized/redpanda.
You can use any version from https://hub.docker.com/r/vectorized/redpanda by setting the `quarkus.kafka.devservices.image-name` configuration property.

IMPORTANT: Dev Services for Kafka only support Red Panda.
IMPORTANT: Dev Services for Kafka only support Redpanda.
Loading

0 comments on commit d9d50a2

Please sign in to comment.