|
3 | 3 | Quarkus provides a novel reactive API called Mutiny, with the goal of easing the development of highly scalable, resilient, and asynchronous systems. |
4 | 4 |
|
5 | 5 | In this chapter we're going to see some examples of how Mutiny changes the design of our Quarkus applications. |
6 | | -to online beer database (https://punkapi.com/documentation/v2) to retrieve beer information. |
| 6 | +We're going to call an online beer database to retrieve beer information. |
7 | 7 | This API does not return all beers at once, so we'll need to navigate through the pages to fetch all the information. |
8 | 8 | Then we're going to filter all the beers with an ABV greater than 15.0 and return all these beers in a Reactive REST endpoint. |
9 | 9 |
|
10 | 10 | == Add the Mutiny extension |
11 | 11 |
|
12 | | -Create a new Quarkus project, for example using https://code.quarkus.io/ website. |
| 12 | +Let's create a new Quarkus project and add the Rest, Rest Client and Mutiny extensions: |
13 | 13 |
|
14 | | -Then open a new terminal window, and make sure you’re at the root of your `{project-name}` project, then run: |
15 | | - |
16 | | -[tabs] |
| 14 | +[tabs%sync] |
17 | 15 | ==== |
| 16 | +
|
18 | 17 | Maven:: |
19 | 18 | + |
20 | 19 | -- |
21 | 20 | [.console-input] |
22 | 21 | [source,bash,subs="+macros,+attributes"] |
23 | 22 | ---- |
24 | | -./mvnw quarkus:add-extension -Dextension=mutiny,rest-client-jsonb,rest-jsonb |
| 23 | +mvn "io.quarkus.platform:quarkus-maven-plugin:create" -DprojectGroupId="com.redhat.developers" -DprojectArtifactId="tutorial-app" -DprojectVersion="1.0-SNAPSHOT" -Dextensions=rest,mutiny,rest-client-jsonb,rest-jsonb |
| 24 | +cd {project-name} |
25 | 25 | ---- |
26 | | -
|
27 | 26 | -- |
28 | 27 | Quarkus CLI:: |
29 | 28 | + |
30 | 29 | -- |
31 | 30 | [.console-input] |
32 | 31 | [source,bash,subs="+macros,+attributes"] |
33 | 32 | ---- |
34 | | -quarkus extension add mutiny,rest-client-jsonb,rest-jsonb |
| 33 | +quarkus create app -x rest -x mutiny -x rest-client-jsonb -x rest-jsonb com.redhat.developers:tutorial-app:1.0-SNAPSHOT |
| 34 | +cd {project-name} |
35 | 35 | ---- |
36 | 36 | -- |
37 | 37 | ==== |
|
0 commit comments