Skip to content

Commit

Permalink
Update cloud events lab and solution
Browse files Browse the repository at this point in the history
  • Loading branch information
g1raffi committed Dec 8, 2024
1 parent 2ee9d2a commit bd00ad8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 51 deletions.
35 changes: 10 additions & 25 deletions content/en/docs/08.0/83_cloudevents.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,34 +101,18 @@ Remove the test classes and add the following extensions to your projects' `pom.
> Dependencies in `pom.xml`
```xml

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-confluent-registry-avro</artifactId>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
<version>{{% param "confluentKafkaAvroVersion" %}}</version>
<exclusions>
<exclusion>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</exclusion>
</exclusions>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-apicurio-registry-avro</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</exclusion>
</exclusions>
</dependency>

...

<repositories>
<repository>
<id>confluent</id>
<url>https://packages.confluent.io/maven/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

```

For demonstration purposes we use a Avro-schema, which is the most common approach to manage schemas with Kafka.
Expand Down Expand Up @@ -218,6 +202,7 @@ Of course, we need some configuration in the `application.properties` to emit th
# Uncomment if you do not want to use the devservices redpanda container.
# kafka.bootstrap.servers=localhost:9092

mp.messaging.outgoing.measurements.apicurio.registry.auto-register=true
mp.messaging.outgoing.measurements.connector=smallrye-kafka
mp.messaging.outgoing.measurements.value.serializer=io.confluent.kafka.serializers.KafkaAvroSerializer
mp.messaging.outgoing.measurements.topic=measurements
Expand Down
13 changes: 1 addition & 12 deletions solution/quarkus-cloudevents-consumer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-confluent-registry-avro</artifactId>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
<version>7.5.1</version>
<exclusions>
<exclusion>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</exclusion>
</exclusions>
<artifactId>quarkus-apicurio-registry-avro</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
quarkus.http.port=8081

# If you'd like to use Redpanda from the devservices instead of a docker-compose kafka cluster simply comment or remove the line below
kafka.bootstrap.servers=localhost:9092
# kafka.bootstrap.servers=localhost:9092

mp.messaging.incoming.measurements.connector=smallrye-kafka
mp.messaging.incoming.measurements.topic=measurements
Expand Down
12 changes: 1 addition & 11 deletions solution/quarkus-cloudevents-producer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,14 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-confluent-registry-avro</artifactId>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
<version>7.5.1</version>
<artifactId>quarkus-apicurio-registry-avro</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.11.1</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# If you'd like to use Redpanda from the devservices instead of a docker-compose kafka cluster simply comment or remove the line below
kafka.bootstrap.servers=localhost:9092
# kafka.bootstrap.servers=localhost:9092

mp.messaging.outgoing.measurements.connector=smallrye-kafka
mp.messaging.outgoing.measurements.value.serializer=io.confluent.kafka.serializers.KafkaAvroSerializer
mp.messaging.outgoing.measurements.apicurio.registry.auto-register=true

mp.messaging.outgoing.measurements.topic=measurements
#mp.messaging.outgoing.measurements.cloud-events-source=cloudevents-producer
#mp.messaging.outgoing.measurements.cloud-events-type=measurement-emitted
Expand Down

0 comments on commit bd00ad8

Please sign in to comment.