From 735ab2d37a1a0b421edeb7c606fe3aeca24f5114 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 13 Sep 2024 10:56:43 -0300 Subject: [PATCH 1/5] Bump to Quarkus 3.14.3 --- quarkus-workshop-super-heroes/docs/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quarkus-workshop-super-heroes/docs/pom.xml b/quarkus-workshop-super-heroes/docs/pom.xml index 1a5a34625..5022b915e 100644 --- a/quarkus-workshop-super-heroes/docs/pom.xml +++ b/quarkus-workshop-super-heroes/docs/pom.xml @@ -46,7 +46,7 @@ The default build will take around 50m. quarkus-bom io.quarkus - 3.6.0 + 3.14.3 1.3.0 0.2.11-alpha 3.11.0 From a3bf531672382390cc1813b21122ca86f8859182 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 13 Sep 2024 10:56:35 -0300 Subject: [PATCH 2/5] Update GraalVM installation instructions --- .../introduction-installing-graalvm.adoc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-introduction/introduction-installing-graalvm.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-introduction/introduction-installing-graalvm.adoc index 07f80bf8e..3d20609f9 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-introduction/introduction-installing-graalvm.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-introduction/introduction-installing-graalvm.adoc @@ -103,15 +103,6 @@ endif::use-mac[] Once installed, define the `GRAALVM_HOME` environment variable to point to the directory where GraalVM is installed (eg. on Mac OS X it could be `~/.sdkman/candidates/java/{graalvm-version}.r{jdk-version}-grl`). -The `native-image` tool must be installed. -It can be done by running the following command under `$GRAALVM_HOME/bin` - -[source,shell] ----- -./gu install native-image ----- - -from your GraalVM `bin` directory. ifdef::use-mac[] [NOTE] @@ -141,6 +132,8 @@ You should get something like: [source,shell] ---- -GraalVM 22.3.1 Java 17 CE (Java Version 17.0.6+10-jvmci-22.3-b13) +native-image 22.0.2 2024-07-16 +OpenJDK Runtime Environment Mandrel-24.0.2.0-Final (build 22.0.2+9) +OpenJDK 64-Bit Server VM Mandrel-24.0.2.0-Final (build 22.0.2+9, mixed mode) ---- From a957864dc5781b3ec649aaa02ca5ecd34a6e9c28 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 13 Sep 2024 11:00:13 -0300 Subject: [PATCH 3/5] Bump to Maven 3.9.x --- quarkus-workshop-super-heroes/docs/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quarkus-workshop-super-heroes/docs/pom.xml b/quarkus-workshop-super-heroes/docs/pom.xml index 5022b915e..ce3b35b3c 100644 --- a/quarkus-workshop-super-heroes/docs/pom.xml +++ b/quarkus-workshop-super-heroes/docs/pom.xml @@ -153,7 +153,7 @@ The default build will take around 50m. ${maven.compiler.source} 22.3 - 3.8.x + 3.9.x ${quarkus.platform.version} ${compiler-plugin.version} ${surefire-plugin.version} From 6ef1baadab43f019d96496bf724fb8185a0a7fa8 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 13 Sep 2024 11:14:36 -0300 Subject: [PATCH 4/5] Replace references from resteasy-reactive to rest --- .../microservices-fight.adoc | 4 +-- .../docs/asciidoc/core-reactive/reactive.adoc | 6 ++-- .../core-rest/rest-bootstrapping.adoc | 34 +++++++++---------- .../src/docs/asciidoc/core-rest/rest-orm.adoc | 2 +- .../src/docs/asciidoc/core-rest/rest.adoc | 2 +- .../src/docs/asciidoc/optional-ai/ai.adoc | 4 +-- .../messaging-receiving-from-kafka.adoc | 2 +- .../quarkus-extension.adoc | 2 +- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-microservices/microservices-fight.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-microservices/microservices-fight.adoc index 80b99fbec..ee2b764af 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-microservices/microservices-fight.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-microservices/microservices-fight.adoc @@ -27,7 +27,7 @@ Open a terminal and run the following command: -DprojectArtifactId=rest-fights \ -DclassName="io.quarkus.workshop.superheroes.fight.FightResource" \ -Dpath="api/fights" \ - -Dextensions="jdbc-postgresql,hibernate-orm-panache,hibernate-validator,quarkus-resteasy-reactive-jackson,smallrye-openapi,kafka" + -Dextensions="jdbc-postgresql,hibernate-orm-panache,hibernate-validator,rest-jackson,smallrye-openapi,kafka" ---- If you open the `pom.xml` file, you will see that the following extensions have been imported: @@ -36,7 +36,7 @@ If you open the `pom.xml` file, you will see that the following extensions have * `io.quarkus:quarkus-hibernate-validator` * `io.quarkus:quarkus-smallrye-openapi` * `io.quarkus:quarkus-messaging-kafka` -* `io.quarkus:quarkus-resteasy-reactive-jackson` +* `io.quarkus:quarkus-rest-jackson` * `io.quarkus:quarkus-jdbc-postgresql` -- diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-reactive/reactive.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-reactive/reactive.adoc index 60d9f2ac6..422c0d6b7 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-reactive/reactive.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-reactive/reactive.adoc @@ -17,7 +17,7 @@ include::{plantDir}/3-reactive-physical-architecture.puml[] In the following sections, you will learn: * How to create a new reactive Quarkus application -* How to implement REST API using JAX-RS and the RESTEasy Reactive extension using a reactive development model +* How to implement REST API using JAX-RS and the Quarkus REST extension using a reactive development model * How to access your database using Hibernate Reactive with Panache * How to use transactions the reactive way @@ -54,13 +54,13 @@ Open a terminal and run the following command under the `quarkus-workshop-super- -DprojectArtifactId=rest-heroes \ -DclassName="io.quarkus.workshop.superheroes.hero.HeroResource" \ -Dpath="api/heroes" \ - -Dextensions="resteasy-reactive-jackson,quarkus-hibernate-validator,quarkus-smallrye-openapi,quarkus-hibernate-reactive-panache,quarkus-reactive-pg-client" + -Dextensions="rest-jackson,quarkus-hibernate-validator,quarkus-smallrye-openapi,quarkus-hibernate-reactive-panache,quarkus-reactive-pg-client" ---- -- As you can see, we can select multiple extensions during the project creation: -* `resteasy-reactive-jackson` provides RESTEasy Reactive and the ability to map JSON objects, +* `rest-jackson` provides Quarkus REST and the ability to map JSON objects, * `quarkus-hibernate-validator` provides the Hibernate Validator support, * `quarkus-smallrye-openapi` provides the OpenAPI descriptor support and the Swagger UI in the dev console, * `quarkus-hibernate-reactive-panache` provides Panache entity supports using Hibernate Reactive, an ORM using reactive database drivers, diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest-bootstrapping.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest-bootstrapping.adoc index ae7739251..3243fe33d 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest-bootstrapping.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest-bootstrapping.adoc @@ -20,12 +20,12 @@ Open a terminal and run the following command under the `quarkus-workshop-super- -DprojectArtifactId=rest-villains \ -DclassName="io.quarkus.workshop.superheroes.villain.VillainResource" \ -Dpath="api/villains" \ - -Dextensions="resteasy-reactive-jackson" + -Dextensions="rest-jackson" ---- [NOTE] ==== -Notice that we scaffold the project with a reactive implementation of RestEasy (`resteasy-reactive-jackson`). +Notice that we scaffold the project with Quarkus REST (`rest-jackson`). This is the recommended way to develop REST applications with Quarkus even if we use the imperative programming model in the Villain microservice. ==== @@ -33,7 +33,7 @@ Remember that `mvnw` is the maven wrapper. It behaves like `mvn`, but allows a project's build dependencies to be encapsulated. The last line selects the extension we want to use. -As a start, we only select `resteasy-reactive-jackson`, which will also import `resteasy-reactive`. +As a start, we only select `rest-jackson`, which will also import `rest`. If you want your IDE to manage this new Maven project, you can declare it in the parent POM (`quarkus-super-heroes/pom.xml`) by adding this new module in the `` section: @@ -45,7 +45,7 @@ If you want your IDE to manage this new Maven project, you can declare it in the [TIP] .Prefer a Web UI? ==== -Instead of the Maven command, you can use https://code.quarkus.io and select the `resteasy-reactive-jackson` extension. +Instead of the Maven command, you can use https://code.quarkus.io and select the `rest-jackson` extension. ==== == Directory Structure @@ -165,7 +165,7 @@ In addition, you can see the `quarkus-maven-plugin` responsible for the packagin ---- -If we focus on the dependencies section, you can see the extensions allowing the development of REST applications (resteasy-reactive and resteasy-reactive-jackson) +If we focus on the dependencies section, you can see the extensions allowing the development of REST applications (`rest` and `rest-jackson`) [source,xml,indent=0] ---- @@ -176,11 +176,11 @@ If we focus on the dependencies section, you can see the extensions allowing the io.quarkus - quarkus-resteasy-reactive + quarkus-rest io.quarkus - quarkus-resteasy-reactive-jackson + quarkus-rest-jackson @@ -189,9 +189,9 @@ If we focus on the dependencies section, you can see the extensions allowing the * `quarkus-arc` is the dependency injection framework integrated into Quarkus. It's designed to perform build-time injections. We will see later why this is essential for Quarkus. -* `resteasy-reactive` is the framework we will use to implement our REST API. +* `quarkus-rest` is the framework we will use to implement our REST API. It uses JAX-RS annotations such as `@Path`, `@GET`... -* `reasteasy-reactive-jackson` adds JSON object mapping capabilities to RESTEasy reactive. +* `quarkus-rest-jackson` adds JSON object mapping capabilities to Quarkus REST. == The Villain Resource @@ -212,7 +212,7 @@ public class VillainResource { @GET @Produces(MediaType.TEXT_PLAIN) public String hello() { - return "Hello from RESTEasy Reactive"; + return "Hello from Quarkus REST"; } } ---- @@ -263,7 +263,7 @@ __ ____ __ _____ ___ __ ____ ______ 2022-11-15 14:05:29,414 INFO [io.quarkus] (Quarkus Main Thread) rest-villains 1.0.0-SNAPSHOT on JVM (powered by Quarkus {quarkus-version}) started in 1.093s. Listening on: http://localhost:8080 2022-11-15 14:05:29,423 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated. -2022-11-15 14:05:29,423 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, vertx] +2022-11-15 14:05:29,423 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, rest, rest-jackson, smallrye-context-propagation, vertx] Tests paused Press [r] to resume testing, [o] Toggle test output, [:] for the terminal, [h] for more options> @@ -280,7 +280,7 @@ You should see the following [source,shell] ---- -Hello from RESTEasy Reactive +Hello from Quarkus REST ---- Alternatively, you can open http://localhost:8080/api/villains in your browser. @@ -377,7 +377,7 @@ public class VillainResourceTest { .when().get("/api/villains") .then() .statusCode(200) - .body(is("Hello from RESTEasy Reactive")); + .body(is("Hello from Quarkus REST")); } } @@ -416,7 +416,7 @@ Unfortunately, this first run didn't end well: 2022-11-15 14:13:17,925 ERROR [io.qua.test] (Test runner thread) Test VillainResourceTest#testHelloEndpoint() failed : java.lang.AssertionError: 1 expectation failed. Response body doesn't match expectation. -Expected: is "Hello from RESTEasy Reactive" +Expected: is "Hello from Quarkus REST" Actual: Hello Villain Resource at io.restassured.internal.ValidatableResponseImpl.body(ValidatableResponseImpl.groovy) @@ -426,7 +426,7 @@ Expected: is "Hello from RESTEasy Reactive" 2022-11-15 14:13:17,927 ERROR [io.qua.test] (Test runner thread) >>>>>>>>>>>>>>>>>>>> Summary: <<<<<<<<<<<<<<<<<<<< io.quarkus.workshop.superheroes.villain.VillainResourceTest#testHelloEndpoint(VillainResourceTest.java:18) VillainResourceTest#testHelloEndpoint() 1 expectation failed. Response body doesn't match expectation. -Expected: is "Hello from RESTEasy Reactive" +Expected: is "Hello from Quarkus REST" Actual: Hello Villain Resource 2022-11-15 14:13:17,929 ERROR [io.qua.test] (Test runner thread) >>>>>>>>>>>>>>>>>>>> 1 TEST FAILED <<<<<<<<<<<<<<<<<<<< @@ -435,7 +435,7 @@ Expected: is "Hello from RESTEasy Reactive" 2022-11-15 14:13:18,155 ERROR [io.qua.test] (Test runner thread) Test VillainResourceTest#testHelloEndpoint() failed : java.lang.AssertionError: 1 expectation failed. Response body doesn't match expectation. -Expected: is "Hello from RESTEasy Reactive" +Expected: is "Hello from Quarkus REST" Actual: Hello Villain Resource at io.restassured.internal.ValidatableResponseImpl.body(ValidatableResponseImpl.groovy) @@ -445,7 +445,7 @@ Expected: is "Hello from RESTEasy Reactive" 2022-11-15 14:13:18,156 ERROR [io.qua.test] (Test runner thread) >>>>>>>>>>>>>>>>>>>> Summary: <<<<<<<<<<<<<<<<<<<< io.quarkus.workshop.superheroes.villain.VillainResourceTest#testHelloEndpoint(VillainResourceTest.java:18) VillainResourceTest#testHelloEndpoint() 1 expectation failed. Response body doesn't match expectation. -Expected: is "Hello from RESTEasy Reactive" +Expected: is "Hello from Quarkus REST" Actual: Hello Villain Resource 2022-11-15 14:13:18,157 ERROR [io.qua.test] (Test runner thread) >>>>>>>>>>>>>>>>>>>> 1 TEST FAILED <<<<<<<<<<<<<<<<<<<< diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest-orm.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest-orm.adoc index db3752e56..2287a422b 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest-orm.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest-orm.adoc @@ -62,7 +62,7 @@ To add the required dependencies, just run the following command under the `supe ---- -- -TIP: No need to add an extension for JSON, we already included `resteasy-reactive-jackson`. +TIP: No need to add an extension for JSON, we already included `rest-jackson`. This will add the following dependencies in the `pom.xml` file: diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest.adoc index 4662c0b3c..1620b76d6 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/core-rest/rest.adoc @@ -21,7 +21,7 @@ include::{plantDir}/1-rest-physical-architecture.puml[] In the following sections, you learn: * How to create a new Quarkus application -* How to implement REST API using JAX-RS and the RESTEasy Reactive extensionfootnote:[RESTEasy Reactive support the reactive and imperative development models.] +* How to implement REST API using JAX-RS and the Quarkus REST extension footnote:[Quarkus REST supports the reactive and imperative development models.] * How to compose your application using beans * How to access your database using Hibernate ORM with Panache * How to use transactions diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-ai/ai.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-ai/ai.adoc index 22016b42b..df2ae1738 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-ai/ai.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-ai/ai.adoc @@ -58,13 +58,13 @@ Open a terminal and run the following command under the `quarkus-workshop-super- -DprojectArtifactId=rest-narration \ -DclassName="io.quarkus.workshop.superheroes.narration.NarrationResource" \ -Dpath="api/narration" \ - -Dextensions="resteasy-reactive-jackson,quarkus-smallrye-openapi,quarkus-smallrye-fault-tolerance" + -Dextensions="rest-jackson,quarkus-smallrye-openapi,quarkus-smallrye-fault-tolerance" ---- -- This microservice needs less dependencies than the previous ones: -* `resteasy-reactive-jackson` provides RESTEasy Reactive and the ability to map JSON objects, +* `rest-jackson` provides Quarkus REST and the ability to map JSON objects, * `quarkus-smallrye-openapi` provides the OpenAPI descriptor support and the Swagger UI in the dev console, * `quarkus-smallrye-fault-tolerance` provides the MicroProfile Fault Tolerance dependency so we can fallback in case OpenAI/Azure OpenAI does not respond. diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-messaging/messaging-receiving-from-kafka.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-messaging/messaging-receiving-from-kafka.adoc index 822e9791b..642c01be8 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-messaging/messaging-receiving-from-kafka.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-messaging/messaging-receiving-from-kafka.adoc @@ -55,7 +55,7 @@ Open a terminal and run the following command: -DprojectArtifactId=event-statistics \ -DclassName="io.quarkus.workshop.superheroes.statistics.StatisticResource" \ -Dpath="api/stats" \ - -Dextensions="kafka, resteasy-reactive-jackson, websockets" + -Dextensions="kafka, rest-jackson, websockets" ---- -- diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-quarkus-extension/quarkus-extension.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-quarkus-extension/quarkus-extension.adoc index 49aa216f8..44961f0f2 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-quarkus-extension/quarkus-extension.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/optional-quarkus-extension/quarkus-extension.adoc @@ -247,7 +247,7 @@ And the version will be displayed: ---- 10:16:58 INFO [io.qu.wo.su.ve.ru.VersionRecorder] (Quarkus Main Thread) Version: 1.0.0-SNAPSHOT ... -10:17:00 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [agroal, cdi, extension-version, hibernate-orm, hibernate-orm-panache, hibernate-validator, jdbc-postgresql, narayana-jta, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, smallrye-health, smallrye-openapi, swagger-ui, vertx] +10:17:00 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [agroal, cdi, extension-version, hibernate-orm, hibernate-orm-panache, hibernate-validator, jdbc-postgresql, narayana-jta, rest, rest-jackson, smallrye-context-propagation, smallrye-health, smallrye-openapi, swagger-ui, vertx] ---- == Conclusion From 1594048cbaa992545e02552c58f2e8756b1af372 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 13 Sep 2024 11:17:21 -0300 Subject: [PATCH 5/5] Add George Gastaldi to the list of authors --- quarkus-workshop-super-heroes/docs/src/docs/asciidoc/spine.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/spine.adoc b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/spine.adoc index 18ba61f34..3f33b144c 100644 --- a/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/spine.adoc +++ b/quarkus-workshop-super-heroes/docs/src/docs/asciidoc/spine.adoc @@ -1,5 +1,5 @@ = Quarkus Super-Heroes Workshop: {docdate} Quarkus {quarkus-version} -Emmanuel Bernard; Clement Escoffier; Antonio Goncalves; Aurea Munoz Hernandez; Georgios Andrianakis; Holly Cummins +Emmanuel Bernard; Clement Escoffier; Antonio Goncalves; Aurea Munoz Hernandez; Georgios Andrianakis; Holly Cummins; George Gastaldi :doctype: book :source-highlighter: coderay :source-language: java