Skip to content

Commit

Permalink
Move on to new Quarkus apicurio registry library
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo gonzalez granados authored and Sgitario committed Sep 10, 2021
1 parent 35e2ac7 commit 564d327
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 52 deletions.
22 changes: 7 additions & 15 deletions messaging/kafka-avro-reactive-messaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jsonb</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-apicurio-registry-avro</artifactId>
</dependency>
<!-- Quarkus extension for generating Java code from Avro schemas -->
<!-- with this, you don't have to use avro-maven-plugin -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-avro</artifactId>
</dependency>
<!-- Confluent AVRO libraries -->
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
Expand All @@ -30,21 +37,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-scheduler</artifactId>
</dependency>
<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-registry-utils-serde</artifactId>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.interceptor</groupId>
<artifactId>jboss-interceptors-api_1.2_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- quarkiverse-apicurio-registry-client: native mode dependency -->
<dependency>
<groupId>io.quarkiverse.apicurio</groupId>
<artifactId>quarkiverse-apicurio-registry-client</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
%dev.kafka.bootstrap.servers=localhost:9092
#TODO: Disable health check because of https://github.com/quarkusio/quarkus/issues/15464
%dev.quarkus.reactive-messaging.health.enabled=false
%dev.mp.messaging.connector.smallrye-kafka.apicurio.registry.url=http://localhost:8081/api
%dev.mp.messaging.connector.smallrye-kafka.apicurio.registry.url=http://localhost:8081/apis/registry/v2
%dev.mp.messaging.outgoing.source-stock-price.connector=smallrye-kafka
%dev.mp.messaging.outgoing.source-stock-price.topic=stock-price
%dev.mp.messaging.outgoing.source-stock-price.value.serializer=io.apicurio.registry.utils.serde.AvroKafkaSerializer
%dev.mp.messaging.outgoing.source-stock-price.apicurio.registry.artifact-id=io.apicurio.registry.utils.serde.strategy.SimpleTopicIdStrategy
%dev.mp.messaging.outgoing.source-stock-price.apicurio.registry.global-id=io.apicurio.registry.utils.serde.strategy.GetOrCreateIdStrategy
%dev.mp.messaging.outgoing.source-stock-price.apicurio.registry.avro-datum-provider=io.apicurio.registry.utils.serde.avro.ReflectAvroDatumProvider
%dev.mp.messaging.outgoing.source-stock-price.value.serializer=io.apicurio.registry.serde.avro.AvroKafkaSerializer
%dev.mp.messaging.outgoing.source-stock-price.apicurio.registry.avro-datum-provider=io.apicurio.registry.serde.avro.ReflectAvroDatumProvider
%dev.mp.messaging.outgoing.source-stock-price.apicurio.registry.auto-register=true

%dev.mp.messaging.incoming.channel-stock-price.connector=smallrye-kafka
%dev.mp.messaging.incoming.channel-stock-price.topic=stock-price
%dev.mp.messaging.incoming.channel-stock-price.specific.avro.reader=true
%dev.mp.messaging.incoming.channel-stock-price.value.deserializer=io.apicurio.registry.utils.serde.AvroKafkaDeserializer
%dev.mp.messaging.incoming.channel-stock-price.value.deserializer=io.apicurio.registry.serde.avro.AvroKafkaDeserializer
%dev.mp.messaging.incoming.channel-stock-price.auto.offset.reset=earliest
%dev.mp.messaging.incoming.channel-stock-price.enable.auto.commit=true
%dev.mp.messaging.incoming.channel-stock-price.apicurio.registry.avro-datum-provider=io.apicurio.registry.utils.serde.avro.ReflectAvroDatumProvider
%dev.mp.messaging.incoming.channel-stock-price.apicurio.registry.avro-datum-provider=io.apicurio.registry.serde.avro.ReflectAvroDatumProvider
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181

schema-registry:
image: apicurio/apicurio-registry-mem:1.3.1.Final
image: apicurio/apicurio-registry-mem:2.0.1.Final
ports:
- 8081:8080
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
@EnabledIfSystemProperty(named = "ts.redhat.registry.enabled", matches = "true")
public class OpenShiftAmqStreamsKafkaAvroIT extends BaseKafkaAvroIT {

@KafkaContainer(vendor = KafkaVendor.STRIMZI, image = "${amq-streams.image}", version = "${amq-streams.version}", withRegistry = true)
@KafkaContainer(vendor = KafkaVendor.STRIMZI, image = "${amq-streams.image}", version = "${amq-streams.version}", withRegistry = true, registryPath = "/apis/registry/v2")
static KafkaService kafka = new KafkaService();

@QuarkusApplication
static RestService app = new RestService()
.withProperties("strimzi-application.properties")
.withProperty("kafka.bootstrap.servers", kafka::getBootstrapUrl)
.withProperty("kafka.registry.url", kafka::getRegistryUrl);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@QuarkusScenario
public class StrimziKafkaAvroIT extends BaseKafkaAvroIT {

@KafkaContainer(vendor = KafkaVendor.STRIMZI, withRegistry = true)
@KafkaContainer(vendor = KafkaVendor.STRIMZI, withRegistry = true, registryPath = "/apis/registry/v2")
static KafkaService kafka = new KafkaService();

@QuarkusApplication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Configuration file - Quarkus profile: Strimzi
kafka.bootstrap.servers=kafka-broker-1:9092
mp.messaging.outgoing.source-stock-price.connector=smallrye-kafka
# TODO: Disable health check because of https://github.com/quarkusio/quarkus/issues/15464
quarkus.reactive-messaging.health.enabled=false

mp.messaging.connector.smallrye-kafka.apicurio.registry.url=${kafka.registry.url}
mp.messaging.outgoing.source-stock-price.connector=smallrye-kafka

mp.messaging.outgoing.source-stock-price.value.serializer=io.apicurio.registry.serde.avro.AvroKafkaSerializer
mp.messaging.outgoing.source-stock-price.apicurio.registry.avro-datum-provider=io.apicurio.registry.serde.avro.ReflectAvroDatumProvider
mp.messaging.outgoing.source-stock-price.apicurio.registry.auto-register=true
mp.messaging.outgoing.source-stock-price.topic=stock-price
mp.messaging.outgoing.source-stock-price.value.serializer=io.apicurio.registry.utils.serde.AvroKafkaSerializer
mp.messaging.outgoing.source-stock-price.apicurio.registry.artifact-id=io.apicurio.registry.utils.serde.strategy.SimpleTopicIdStrategy
mp.messaging.outgoing.source-stock-price.apicurio.registry.global-id=io.apicurio.registry.utils.serde.strategy.GetOrCreateIdStrategy
mp.messaging.outgoing.source-stock-price.apicurio.registry.avro-datum-provider=io.apicurio.registry.utils.serde.avro.ReflectAvroDatumProvider

mp.messaging.incoming.channel-stock-price.connector=smallrye-kafka
mp.messaging.incoming.channel-stock-price.topic=stock-price
mp.messaging.incoming.channel-stock-price.specific.avro.reader=true
mp.messaging.incoming.channel-stock-price.value.deserializer=io.apicurio.registry.utils.serde.AvroKafkaDeserializer
mp.messaging.incoming.channel-stock-price.auto.offset.reset=earliest
mp.messaging.incoming.channel-stock-price.enable.auto.commit=true
mp.messaging.incoming.channel-stock-price.apicurio.registry.avro-datum-provider=io.apicurio.registry.utils.serde.avro.ReflectAvroDatumProvider
quarkus.openshift.expose=true
mp.messaging.incoming.channel-stock-price.value.deserializer=io.apicurio.registry.serde.avro.AvroKafkaDeserializer
mp.messaging.incoming.channel-stock-price.apicurio.registry.avro-datum-provider=io.apicurio.registry.serde.avro.ReflectAvroDatumProvider

quarkus.openshift.expose=true
18 changes: 0 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<quarkus-qpid-jms.version>0.27.0</quarkus-qpid-jms.version>
<quarkus-ide-config.version>2.2.2.Final</quarkus-ide-config.version>
<apache-httpclient-fluent.version>4.5.13</apache-httpclient-fluent.version>
<apicurio.registry.utils.serde.version>1.3.2.Final</apicurio.registry.utils.serde.version>
<quarkiverse.apicurio.registry.client.version>0.0.2</quarkiverse.apicurio.registry.client.version>
<confluent.kafka-avro-serializer.version>6.2.0</confluent.kafka-avro-serializer.version>
<formatter-maven-plugin.version>2.16.0</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.6.2</impsort-maven-plugin.version>
Expand All @@ -48,12 +46,6 @@
</properties>
<dependencyManagement>
<dependencies>
<!-- TODO: com.squareup.retrofit2:retrofit:2.9.0 should be removed on Quarkus 2.0.0.Alphas-->
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
Expand All @@ -75,16 +67,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-registry-utils-serde</artifactId>
<version>${apicurio.registry.utils.serde.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.apicurio</groupId>
<artifactId>quarkiverse-apicurio-registry-client</artifactId>
<version>${quarkiverse.apicurio.registry.client.version}</version>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
Expand Down

0 comments on commit 564d327

Please sign in to comment.