Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Quarkus 3 #206

Merged
merged 13 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ code/appinfo
META-INF
**.iml
.hugo_build.lock
target
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

In this guided hands-on training, we learn how to implement microservices with help of the Quarkus framework.

The techlab is available on GitHub Pages [here](https://puzzle.github.io/quarkus-techlab/).


## Content Sections

Expand Down
16 changes: 12 additions & 4 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ title = "Quarkus Basics Training"
enableGitInfo = true





languageCode = "en-us"

contentDir = "content/en"
Expand Down Expand Up @@ -79,7 +76,18 @@ github_branch = "master"

lab_code_basedir = "/code/"
solution_code_basedir = "/solution/"
quarkusVersion = "2.11.3.Final"

#versions
quarkusVersion = "3.4.3"
mutinyVersion = "2.5.1"
confluentKafkaAvroVersion = "7.5.1"
openJdkImage = "registry.access.redhat.com/ubi8/openjdk-17:1.16"
ubiQuarkusNativeImage = "quay.io/quarkus/ubi-quarkus-native-image:22.3-java17"
quarkusMicroImage = "quay.io/quarkus/quarkus-micro-image:2.0"
strimziVersion = "quay.io/strimzi/kafka:0.37.0-kafka-3.5.1"
jaegerTracingImage = " quay.io/jaegertracing/all-in-one:1.50.0"
grafanaImage = "docker.io/grafana/grafana:latest"
prometheusImage = "quay.io/prometheus/prometheus:latest"

k8s_user_name = "userXY"
registry_url = "default-route-openshift-image-registry.$CLUSTER_URL"
Expand Down
21 changes: 4 additions & 17 deletions content/en/docs/01.0/13_development.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ Each extension is able to provide custom information shown on the dev ui. Extens
* Custom pages with or without actions to interact the application
* If you are using Flyway you may for example clean and migrate your database using the Dev UI

Example of an ChaosMonkey extension which allows to inject random errors in your rest endpoints.

![Quarkus Dev UI](../dev-ui-monkeys.png)

With the provided Configuration tool, you are able to change the runtime config for example the quarkus log level
Expand All @@ -265,11 +267,12 @@ On Windows using Powershell:
iex "& { $(iwr https://ps.jbang.dev) } app install --fresh --force quarkus@quarkusio"
```

If jbang has already been installed, you can it directly:
If jbang has already been installed, you can install it directly:

```s
# This can also be used to update to the latest version
jbang app install --fresh --force quarkus@quarkusio

# Use the latest (or locally built) snapshot (with qss as an alias)
jbang app install --force --name qss ~/.m2/repository/io/quarkus/quarkus-cli/999-SNAPSHOT/quarkus-cli-999-SNAPSHOT-runner.jar
```
Expand All @@ -289,7 +292,6 @@ Check out `quarkus --help` to get a help information with all the available comm
To create a new Quarkus project simply run the `create` command of the CLI:

```s

quarkus create app test-name

-----------
Expand All @@ -308,7 +310,6 @@ applying codestarts...
--> <pwd>/test-name
-----------
Navigate into this directory and get started: quarkus dev

```

To check out the options for project creation see `quarkus create app --help`.
Expand All @@ -320,7 +321,6 @@ The Quarkus CLI will give you quality of life features when working with extensi
You can list your installed extensions in a Quarkus project by invoking

```s

quarkus ext ls

Looking for the newly published extensions in registry.quarkus.io
Expand All @@ -329,13 +329,11 @@ Current Quarkus extensions installed:
quarkus-resteasy

To get more information, append `--full` to your command line.

```

When looking for new extensions to install you can use the `--installable / -i` option. This will simply list all extensions available. You can also filter your query by using the `--search / -s <key>` for the keyword `<key>`.

```s

quarkus ext ls -is openshift

Current Quarkus extensions installable:
Expand All @@ -347,27 +345,22 @@ To get more information, append `--full` to your command line.
To list only extensions from specific category, append `--category "categoryId"` to your command line.

Add an extension to your project by adding the dependency to your pom.xml or use `quarkus extension add "artifactId"`

```

When you have found your desired extension you can add the extension with

```s

quarkus ext add smallrye-health

[SUCCESS] ✅ Extension io.quarkus:quarkus-smallrye-health has been installed

```

Or to remove extensions use

```s

quarkus ext rm smallrye-health

[SUCCESS] ✅ Extension io.quarkus:quarkus-smallrye-health has been uninstalled

```


Expand All @@ -376,27 +369,21 @@ quarkus ext rm smallrye-health
Building your project with the Quarkus CLI is as simple as:

```s

quarkus build

```

To start up your application in dev mode you can use:

```s

quarkus dev

```

{{% details title="Hint" %}}

They say cool kids use:

```s

alias q=quarkus

```

{{% /details %}}
12 changes: 2 additions & 10 deletions content/en/docs/01.0/15_vertx.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >
Introduction to Vert.x
---

Eclipse Vert.x is a toolkit provided to build reactive applications. The ecosystem is very diverse and versatile. To see the diversity head over to the official [https://vertx.io/docs/](documentation).
Eclipse Vert.x is a toolkit provided to build reactive applications. The ecosystem is very diverse and versatile. To see the diversity head over to the official [documentation](https://vertx.io/docs/).
Quarkus is under the hood powered by Vert.x. Whenever Quarkus serves and HTTP endpoint there is a underlying Vert.x HTTP server to handle the request.


Expand All @@ -17,17 +17,14 @@ Vert.x provides multiple APIs. For starters we are going to take a look at the '
Due to the reactive nature of Vert.x, the API contains mostly asynchronous methods. They follow all a similar syntax:

```java

public void doSomething(param1, param2, Handler<AsyncResult<T>> handler) {
// ...
}

```

Interesting here is the last parameter of the `doSomething` method. It is a function that will be used as a callback whenever the opertion succeeds or fails. Let's look at the example here:

```java

vertx.fileSystem()
.readFile("my-file.txt", ar -> {
if (ar.failed()) {
Expand All @@ -36,7 +33,6 @@ vertx.fileSystem()
System.out.println("File content is: " + ar.result());
}
});

```

The code reads a file as an asynchronous operation and invokes the callback when the file is read. The `Handler<AsyncResult<T>>` handles the file read and provides methods (`cause()`, `failed()`, `result()`) to compute the file read.
Expand All @@ -61,7 +57,6 @@ Mutiny defines two reactive types:
Their usages might look like this:

```java

Multi.createFrom().items("a", "b", "c")
.onItem().transform(String::toUpperCase)
.subscribe().with(
Expand All @@ -75,17 +70,14 @@ Uni.createFrom().item("a")
item -> System.out.println("Received: " + item),
failure -> System.out.println("Failed with " + failure)
);

```

The transformed code example from above to Mutiny will look like this:

```java

Uni<Buffer> uni = vertx.fileSystem().readFile("my-file.txt");
uni.subscribe()
.with(it -> System.out.println("File content is: " + it));

```

To dive further into the Mutiny framework consider checking their [https://smallrye.io/smallrye-mutiny/guides](documentation).
To dive further into the Mutiny framework consider checking their [documentation](https://smallrye.io/smallrye-mutiny/guides).
Loading