Skip to content

Commit 425b000

Browse files
authored
Merge pull request quarkusio#878 from Ladicek/apicurio-registry-avro
Use Apicurio Registry Avro extension in the Kafka Avro quickstart
2 parents 9936eb4 + ea25bdf commit 425b000

File tree

4 files changed

+2
-58
lines changed

4 files changed

+2
-58
lines changed

kafka-avro-schema-quickstart/pom.xml

+1-6
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,12 @@
4646
</dependency>
4747
<dependency>
4848
<groupId>io.quarkus</groupId>
49-
<artifactId>quarkus-avro</artifactId>
49+
<artifactId>quarkus-apicurio-registry-avro</artifactId>
5050
</dependency>
5151
<dependency>
5252
<groupId>io.quarkus</groupId>
5353
<artifactId>quarkus-arc</artifactId>
5454
</dependency>
55-
<dependency>
56-
<groupId>io.apicurio</groupId>
57-
<artifactId>apicurio-registry-serdes-avro-serde</artifactId>
58-
<version>2.0.0.Final</version>
59-
</dependency>
6055
<dependency>
6156
<groupId>io.quarkus</groupId>
6257
<artifactId>quarkus-junit5</artifactId>
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
# set the URL of the Apicurio Schema Registry, a global setting shared between all Kafka producers and consumers
2-
mp.messaging.connector.smallrye-kafka.apicurio.registry.url=http://localhost:8081/apis/registry/v2
3-
41
# set the connector to use for the `movies` channel to smallrye-kafka
52
mp.messaging.outgoing.movies.connector=smallrye-kafka
63

74
# the name of the corresponding Kafka topic to `movies`
85
mp.messaging.outgoing.movies.topic=movies
96

10-
# set the serializer for the `movies` channel to the Apicurio Avro Serializer
11-
mp.messaging.outgoing.movies.value.serializer=io.apicurio.registry.serde.avro.AvroKafkaSerializer
12-
137
# automatically register the schema with the registry, if not present
148
mp.messaging.outgoing.movies.apicurio.registry.auto-register=true
159

@@ -19,15 +13,10 @@ mp.messaging.incoming.movies-from-kafka.connector=smallrye-kafka
1913
# set the topic name for the channel to `movies`
2014
mp.messaging.incoming.movies-from-kafka.topic=movies
2115

22-
# set the deserializer for the `movies-from-kafka` channel to the Apicurio Avro Deserializer
23-
mp.messaging.incoming.movies-from-kafka.value.deserializer=io.apicurio.registry.serde.avro.AvroKafkaDeserializer
24-
2516
# disable auto-commit, Reactive Messaging handles it itself
2617
mp.messaging.incoming.movies-from-kafka.enable.auto.commit=false
2718

2819
mp.messaging.incoming.movies-from-kafka.auto.offset.reset=earliest
2920
mp.messaging.incoming.movies-from-kafka.apicurio.registry.use-specific-avro-reader=true
3021

31-
# TODO: this should not be needed, but Avro does not seem to use the correct CL
32-
# This will also cause dev mode issues
33-
quarkus.test.flat-class-path=true
22+
%prod.mp.messaging.connector.smallrye-kafka.apicurio.registry.url=http://localhost:8081/apis/registry/v2

kafka-avro-schema-quickstart/src/test/java/org/acme/kafka/KafkaAndSchemaRegistryTestResource.java

-36
This file was deleted.

kafka-avro-schema-quickstart/src/test/java/org/acme/kafka/MovieResourceTest.java

-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.acme.kafka;
22

3-
import io.quarkus.test.common.QuarkusTestResource;
43
import io.quarkus.test.common.http.TestHTTPResource;
54
import io.quarkus.test.junit.QuarkusTest;
65
import io.restassured.http.ContentType;
@@ -18,14 +17,11 @@
1817
import java.util.concurrent.Executors;
1918

2019
import static io.restassured.RestAssured.given;
21-
import static java.util.concurrent.TimeUnit.MILLISECONDS;
2220
import static java.util.concurrent.TimeUnit.SECONDS;
2321
import static org.awaitility.Awaitility.await;
2422
import static org.hamcrest.MatcherAssert.assertThat;
2523

2624
@QuarkusTest
27-
// register the class that sets up Testcontainers:
28-
@QuarkusTestResource(KafkaAndSchemaRegistryTestResource.class)
2925
public class MovieResourceTest {
3026

3127
@TestHTTPResource("/consumed-movies")

0 commit comments

Comments
 (0)